Skip to content

Commit 7fea63f

Browse files
authored
Update dom.js
1 parent d870383 commit 7fea63f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/utils/dom.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ export const isVisible = el => /* istanbul ignore next: getBoundingClientRect()
6060
if (!isElement(el) || !contains(document.body, el)) {
6161
return false
6262
}
63+
if (el.style.display === 'none') {
64+
// We do this check to help with vue-test-utils when using v-show
65+
return false
66+
}
6367
// All browsers support getBoundingClientRect(), except JSDOM as it returns all 0's for values :(
6468
// So any tests that need isVisible will fail in JSDOM
6569
const bcr = getBCR(el)

0 commit comments

Comments
 (0)