diff options
| author | Johann-S <[email protected]> | 2020-05-06 06:30:43 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-05-06 07:30:43 +0300 |
| commit | f91788548cad3a90e695641b319f49bce952e281 (patch) | |
| tree | 2aa883b59b2fb9719fd99563b6969a0cd605d2a8 /js/src | |
| parent | 122c99ebebc56a565705ed5a3d98dcfa22d40aa1 (diff) | |
| download | bootstrap-f91788548cad3a90e695641b319f49bce952e281.tar.xz bootstrap-f91788548cad3a90e695641b319f49bce952e281.zip | |
enforce element check on scrollspy target (#30747)
Diffstat (limited to 'js/src')
| -rw-r--r-- | js/src/scrollspy.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/js/src/scrollspy.js b/js/src/scrollspy.js index 96dd8303e..cb6c5c624 100644 --- a/js/src/scrollspy.js +++ b/js/src/scrollspy.js @@ -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) |
