2
0
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:
GeoSot
2022-05-20 01:45:06 +03:00
parent 0a3864641b
commit 8b1bfdc3af
+1
View File
@@ -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