mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-30 22:52:24 +01:00
enforce element check on scrollspy target (#30747)
This commit is contained in:
parent
122c99ebeb
commit
f91788548c
@ -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)
|
||||
|
@ -324,7 +324,7 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
|
||||
</tr>
|
||||
<tr>
|
||||
<td>target</td>
|
||||
<td>string</td>
|
||||
<td>string | jQuery object | DOM element</td>
|
||||
<td></td>
|
||||
<td>Specifies element to apply Scrollspy plugin.</td>
|
||||
</tr>
|
||||
|
Loading…
x
Reference in New Issue
Block a user