mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-28 22:39:11 +02:00
Skip hidden dropdowns while focusing (#29523)
This commit is contained in:
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user