-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ScrollSpy skips short sections #15729
Comments
Works fine for me in the problem demo if you go slowly. See this video: https://www.youtube.com/watch?v=gMPX2zttfbo at the 16 second mark you can see it picks it up |
@kkirsche This is because the large JSBin header makes the body really short and the scroll spy more accurate. If you dismiss it, you'll see the problem. |
Still not able to duplicate it @yosefw on Chrome on a Retina Macbook. Video of results on my machine (area in question at 13 seconds approx.): @cvrebert can you duplicate it? |
@kkirsche Not sure what to say. I duplicated the problem both in Firefox and Chrome, on Mac and Windows, with screen resolutions 1680x1050 and 1920x1080 |
I wonder if it is due to being a Retina display at 2560-by-1600 resolution that I can't |
I can occasionally reproduce this, although it seems to go away when I try to debug it... |
It happens when you reach the end of the document, and both are in view… scrollspy tries to be smart and auto highlight the last item (https://github.com/twbs/bootstrap/blob/master/js/scrollspy.js#L88) we could remove this behavior – but it seems pretty deliberate, and I'd hate to get in an infinite loop with this. What is the expected behavior for you? |
@fat Obviously I was expecting each item to light up as I scroll down the page. This override for the end of the page does make some sense, but it's still confusing from a user perspective (I think). I suggest the following compromise:
How does that sound? |
@yosefw +1 For this: Fix the affix behavior to highlight any item the user clicked, even if it's within the viewport with the bottom of the page |
Agreed |
I just want to give you another example. See the navigation on the left side:
|
Perhaps we should highlight all onscreen items instead of just one of them. That would sidestep these issues. |
@cvrebert That would be a solution, but from a usability point of view I think this would confuse users. Imagine this behavior on a page like components with less content. This would cause multiple dropdowns to be expanded and highlighted, which would be |
One more issue:
|
As there is currently no way to persist the navigation state while scrolling, smooth scrolling needs to be disabled completely (see twbs/bootstrap#15729 (comment))
Bootstrap 3 is no longer being officially developed or supported. All work has moved onto our next major release, v4. As such, this issue or pull request is being closed as a "won't fix." For additional help and support, we recommend utilizing our community resources. Thanks for your understanding, and see you on the other side of v4! <3, |
Update: fixed linting issues
Demo: http://jsbin.com/fomona/2/edit
When scrolling through the page, the
affixscrollspy highlights (assigns ".active") the correspondingI found out that it's a combination of the section's height and position. It works fine when it's...
Is there a way to solve this without changing the short section's content or position?
The text was updated successfully, but these errors were encountered: