Browse Source

Fix issue #2208 due to zoom (#3243)

Martin Smit 2 years ago
parent
commit
ffb6293a9a
1 changed files with 2 additions and 2 deletions
  1. 2 2
      packages/collapse/src/index.js

+ 2 - 2
packages/collapse/src/index.js

@@ -19,7 +19,7 @@ export default function (Alpine) {
         // We use the hidden attribute for the benefit of Tailwind
         // We use the hidden attribute for the benefit of Tailwind
         // users as the .space utility will ignore [hidden] elements.
         // users as the .space utility will ignore [hidden] elements.
         // We also use display:none as the hidden attribute has very
         // We also use display:none as the hidden attribute has very
-        // low CSS specificity and could be accidentally overriden
+        // low CSS specificity and could be accidentally overridden
         // by a user.
         // by a user.
         if (! el._x_isShown && fullyHide) el.hidden = true
         if (! el._x_isShown && fullyHide) el.hidden = true
         if (! el._x_isShown) el.style.overflow = 'hidden'
         if (! el._x_isShown) el.style.overflow = 'hidden'
@@ -56,7 +56,7 @@ export default function (Alpine) {
                     start: { height: current+'px' },
                     start: { height: current+'px' },
                     end: { height: full+'px' },
                     end: { height: full+'px' },
                 }, () => el._x_isShown = true, () => {
                 }, () => el._x_isShown = true, () => {
-                    if (el.style.height == `${full}px`) {
+                    if (el.getBoundingClientRect().height == full) {
                         el.style.overflow = null
                         el.style.overflow = null
                     }
                     }
                 })
                 })