1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-11 08:04:59 +02:00

enforce element check on scrollspy target (#30747)

This commit is contained in:
Johann-S
2020-05-06 06:30:43 +02:00
committed by GitHub
parent 122c99ebeb
commit f91788548c
2 changed files with 3 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ import {
getjQuery,
getSelectorFromElement,
getUID,
isElement,
typeCheckConfig
} from './util/index'
import Data from './dom/data'
@@ -168,7 +169,7 @@ class ScrollSpy {
...typeof config === 'object' && config ? config : {}
}
if (typeof config.target !== 'string') {
if (typeof config.target !== 'string' && isElement(config.target)) {
let { id } = config.target
if (!id) {
id = getUID(NAME)