mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-05-15 11:59:39 +03:00
feat(Scrollspy): add history state in every click, when smoothScroll is activated
This commit is contained in:
@@ -127,6 +127,7 @@ 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
|
||||
|
||||
Reference in New Issue
Block a user