Fix: Sidebar scrollbar jumps when changing rooms #113
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #17
The Problem
When navigating between rooms, the sidebar scrollbar would jump momentarily unless it was already at the top position. This visual glitch occurred on all browsers.
Root Cause
The browser's native scroll anchoring feature was conflicting with the app's existing scroll position management during Turbo navigation. When Turbo updates the sidebar content via turbo-frame, the content height temporarily changes. The browser's scroll anchoring tries to maintain position relative to visible content, causing the scrollbar to "jump".
The Fix
Added
overflow-anchor: noneto the.sidebar__containerelement to disable native scroll anchoring.Why This Works
maintain_scroll_controller.js) that handles scroll restoration during Turbo navigationBrowser Support
overflow-anchor: noneis supported in all modern browsers:Testing
AI Disclosure
This PR was developed with AI assistance: