aboutsummaryrefslogtreecommitdiff
path: root/js/src
diff options
context:
space:
mode:
Diffstat (limited to 'js/src')
-rw-r--r--js/src/dropdown.js2
-rw-r--r--js/src/util/index.js9
2 files changed, 8 insertions, 3 deletions
diff --git a/js/src/dropdown.js b/js/src/dropdown.js
index 06a271ef8..4504d61e0 100644
--- a/js/src/dropdown.js
+++ b/js/src/dropdown.js
@@ -9,6 +9,7 @@ import {
getjQuery,
getElementFromSelector,
isElement,
+ isVisible,
makeArray,
noop,
typeCheckConfig
@@ -478,6 +479,7 @@ class Dropdown {
}
const items = makeArray(SelectorEngine.find(Selector.VISIBLE_ITEMS, parent))
+ .filter(isVisible)
if (!items.length) {
return
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