From 8b1bfdc3af52a09171b22b7e244cd16ed3c7a4dc Mon Sep 17 00:00:00 2001 From: GeoSot Date: Fri, 20 May 2022 01:45:06 +0300 Subject: [PATCH] feat(Scrollspy): add history state in every click, when `smoothScroll` is activated --- js/src/scrollspy.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/src/scrollspy.js b/js/src/scrollspy.js index 33447c2bd..d003e4e18 100644 --- a/js/src/scrollspy.js +++ b/js/src/scrollspy.js @@ -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