kitzo 2.1.25 → 2.1.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -26,7 +26,7 @@ npm i kitzo
26
26
  or
27
27
 
28
28
  ```javascript
29
- <script src="https://cdn.jsdelivr.net/npm/kitzo@2.1.25/dist/kitzo.umd.min.js"></script>
29
+ <script src="https://cdn.jsdelivr.net/npm/kitzo@2.1.28/dist/kitzo.umd.min.js"></script>
30
30
  ```
31
31
 
32
32
  > Vanilla: Attach this script tag in the html head tag and you are good to go.
@@ -797,8 +797,6 @@ function Tooltip({
797
797
  style = {},
798
798
  children
799
799
  }) {
800
- const isTouch = window.matchMedia('(pointer: coarse)').matches;
801
- if (isTouch && finalOptions.hideOnTouch) return children;
802
800
  if (typeof content === 'string') {
803
801
  if (!content.trim()) throw new Error('kitzo/react: tooltip content is required');
804
802
  } else if (!content) {
@@ -819,6 +817,10 @@ function Tooltip({
819
817
  smartHover: typeof smartHover === 'boolean' ? smartHover : true,
820
818
  hideOnTouch: typeof hideOnTouch === 'boolean' ? hideOnTouch : true
821
819
  };
820
+
821
+ // Hide on touch device
822
+ const isTouch = window.matchMedia('(pointer: coarse)').matches;
823
+ if (isTouch && finalOptions.hideOnTouch) return children;
822
824
  const positionClass = getPositionClass(finalOptions.position);
823
825
 
824
826
  // Define animations
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kitzo",
3
- "version": "2.1.25",
3
+ "version": "2.1.28",
4
4
  "description": "A lightweight JavaScript & React UI micro-library.",
5
5
  "type": "module",
6
6
  "main": "./dist/vanilla/vanilla.umd.js",