diff options
Diffstat (limited to 'js/src/scrollspy.js')
-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 96dd8303ec..cb6c5c624c 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) |