Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js/src/util
diff options
context:
space:
mode:
authorJeremy Jackson <git@jeremyvii.com>2019-10-17 18:01:44 +0300
committerXhmikosR <xhmikosr@gmail.com>2019-10-17 18:01:44 +0300
commitc1ee395f80c05de8317588b07f34a65c5b95c42c (patch)
tree56d88e6e3e4256ceeea5766af744679e763eb904 /js/src/util
parent104385c508a4c77761b04a9842e978bab6f359f6 (diff)
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 150b4f8773..8a5ae21566 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