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

enforce element check on scrollspy target

This commit is contained in:
Johann-S
2020-05-05 21:42:58 +02:00
committed by XhmikosR
parent 5f267b1854
commit 22f75ca2e3
3 changed files with 3 additions and 3 deletions

View File

@@ -157,7 +157,7 @@ class ScrollSpy {
...typeof config === 'object' && config ? config : {}
}
if (typeof config.target !== 'string') {
if (typeof config.target !== 'string' && Util.isElement(config.target)) {
let id = $(config.target).attr('id')
if (!id) {
id = Util.getUID(NAME)

View File

@@ -127,7 +127,7 @@ $(function () {
.show()
.find('#scrollspy-example')
.bootstrapScrollspy({
target: document.getElementById('#ss-target')
target: document.getElementById('ss-target')
})
$scrollspy.one('scroll', function () {