aboutsummaryrefslogtreecommitdiff
path: root/js/src/util
diff options
context:
space:
mode:
authorJeremy Jackson <[email protected]>2019-10-17 15:01:44 +0000
committerXhmikosR <[email protected]>2019-10-17 18:01:44 +0300
commitc1ee395f80c05de8317588b07f34a65c5b95c42c (patch)
tree56d88e6e3e4256ceeea5766af744679e763eb904 /js/src/util
parent104385c508a4c77761b04a9842e978bab6f359f6 (diff)
downloadbootstrap-c1ee395f80c05de8317588b07f34a65c5b95c42c.tar.xz
bootstrap-c1ee395f80c05de8317588b07f34a65c5b95c42c.zip
Skip hidden dropdowns while focusing (#29523)
Diffstat (limited to 'js/src/util')
-rw-r--r--js/src/util/index.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/js/src/util/index.js b/js/src/util/index.js
index 150b4f877..8a5ae2156 100644
--- a/js/src/util/index.js
+++ b/js/src/util/index.js
@@ -138,9 +138,12 @@ const isVisible = element => {
}
if (element.style && element.parentNode && element.parentNode.style) {
- return element.style.display !== 'none' &&
- element.parentNode.style.display !== 'none' &&
- element.style.visibility !== 'hidden'
+ const elementStyle = getComputedStyle(element)
+ const parentNodeStyle = getComputedStyle(element.parentNode)
+
+ return elementStyle.display !== 'none' &&
+ parentNodeStyle.display !== 'none' &&
+ elementStyle.visibility !== 'hidden'
}
return false