1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-25 21:09:06 +02:00

use get selector from element only when needed

This commit is contained in:
Johann-S
2019-07-23 21:15:00 +02:00
parent f4dbffe93a
commit fc02932946
8 changed files with 82 additions and 49 deletions

View File

@@ -7,7 +7,7 @@
import {
jQuery as $,
getSelectorFromElement,
getElementFromSelector,
isElement,
makeArray,
noop,
@@ -442,14 +442,7 @@ class Dropdown {
}
static _getParentFromElement(element) {
let parent
const selector = getSelectorFromElement(element)
if (selector) {
parent = SelectorEngine.findOne(selector)
}
return parent || element.parentNode
return getElementFromSelector(element) || element.parentNode
}
static _dataApiKeydownHandler(event) {