@mixd-id/web-scaffold 0.1.230406231 → 0.1.230406232

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +5 -3
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mixd-id/web-scaffold",
3
3
  "private": false,
4
- "version": "0.1.230406231",
4
+ "version": "0.1.230406232",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
package/src/index.js CHANGED
@@ -314,9 +314,11 @@ export default{
314
314
  const uid = el.getAttribute('data-tooltip')
315
315
  const tooltip = tooltips[uid]
316
316
  const rect = el.getBoundingClientRect()
317
- tooltip.style.top = (rect.y + rect.height + 10) + 'px'
318
- tooltip.style.left = rect.x - (Math.round((tooltip.clientWidth - rect.width) / 2)) + 'px'
319
- tooltip.classList.add('active')
317
+ if(rect && rect.width > 0){
318
+ tooltip.style.top = (rect.y + rect.height + 10) + 'px'
319
+ tooltip.style.left = rect.x - (Math.round((tooltip.clientWidth - rect.width) / 2)) + 'px'
320
+ tooltip.classList.add('active')
321
+ }
320
322
  }
321
323
  }, 1300)
322
324
  el.setAttribute('data-tooltip-open', true)