1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-06 05:37:39 +02:00

Fix scrollspy and accented anchor links (#38502)

This commit is contained in:
Alejandro Mendoza
2023-04-30 15:31:26 -06:00
committed by GitHub
parent 2795421716
commit a06c2e6b5f
3 changed files with 45 additions and 2 deletions

View File

@@ -208,11 +208,11 @@ class ScrollSpy extends BaseComponent {
continue
}
const observableSection = SelectorEngine.findOne(anchor.hash, this._element)
const observableSection = SelectorEngine.findOne(decodeURI(anchor.hash), this._element)
// ensure that the observableSection exists & is visible
if (isVisible(observableSection)) {
this._targetLinks.set(anchor.hash, anchor)
this._targetLinks.set(decodeURI(anchor.hash), anchor)
this._observableSections.set(anchor.hash, observableSection)
}
}