-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix(Renderer): the scrollLeft reset logic when the element is not scr… #4237
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
base: main
Are you sure you want to change the base?
Conversation
katspaugh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a bug where the scroll position could remain non-zero when the waveform becomes non-scrollable (e.g., after zooming out). The change ensures that when a waveform is not scrollable, any lingering scroll position is reset to 0 during re-render.
- Adds logic in
reRender()to reset scroll position to 0 when content is not scrollable - Adds test coverage for the new behavior when zooming to non-scrollable state
- Updates existing scroll position test to explicitly set zoom level for scrollable state
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/renderer.ts | Adds condition to reset scrollLeft to 0 when waveform is not scrollable |
| src/tests/renderer.test.ts | Adds test for non-scrollable scroll reset and updates existing test to explicitly zoom |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Just FYI, this does not fix #4238. If the waveform is zoomed in and scrolled to the right, then when you zoom out partially (but not all the way zoomed out), the waveform still disappears. I pulled it down and tested. |
Sorry for the late reply, at that time I saw the new issue description looked similar to #3767, I will check #4238 later, and I temporarily removed the association with #4238. |
Short description
Resolves #
fix #3767
Implementation details
How to test it
Screenshots
Checklist