bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

ScrollSpy root-margin gets disabeled by smoot-scroll set to false

Open aeropagz opened this issue 3 years ago • 2 comments

Prerequisites

Describe the issue

Toggleing the smooth-scroll attribute changes the scroll and highlighting behavior in combination with a custom rootMargin.

In my use case I have a sticky top-nav and a negative rootMargin is set to shrink the view. When I disable smoot-scrolling and use the anchors for scrolling the content is partialy disappering behind the navbar.
The Indication of the active Item is off as well. When I set smooth-scroll to true everything works fine.

Reduced test cases

I tried to replicate the test case here in codepen but the ScrollSpy is somehow bugged in there. It behaves different from my own html file which can be found here as a gist.
This gist works right if smooth-scroll is enabled but if it is turned off the highlighting of an active element and the clickable-scrolling is different than before.
For me it looks like the root-margin is disabled.

What operating system(s) are you seeing the problem on?

Windows

What browser(s) are you seeing the problem on?

Firefox, Microsoft Edge

What version of Bootstrap are you using?

v5.2.0

aeropagz avatar Aug 05 '22 09:08 aeropagz

I'm seeing this same issue in 5.2.1

beccahammond avatar Oct 04 '22 19:10 beccahammond

Seeing the same behavior in v5.3.5

romank8k avatar Apr 27 '25 16:04 romank8k