2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-05-15 11:59:39 +03:00

second try

This commit is contained in:
GeoSot
2022-06-11 00:15:52 +03:00
parent 8b1bfdc3af
commit 728aa35613
+2 -1
View File
@@ -127,7 +127,6 @@ class ScrollSpy extends BaseComponent {
event.preventDefault()
const root = this._rootElement || window
const height = observableSection.offsetTop - this._element.offsetTop
window.history.pushState(null, null, event.target.hash)
if (root.scrollTo) {
root.scrollTo({ top: height, behavior: 'smooth' })
return
@@ -222,6 +221,8 @@ class ScrollSpy extends BaseComponent {
this._clearActiveClass(this._config.target)
this._activeTarget = target
window.history.pushState(null, null, target.hash)
target.classList.add(CLASS_NAME_ACTIVE)
this._activateParents(target)