-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Zoom out: maintain scroll position #61465
base: trunk
Are you sure you want to change the base?
Conversation
Size Change: +87 B (0%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
af73d49
to
3f1831a
Compare
@stokesman do you think #63390 will resolve the Issue this PR seeks to fix? |
Yes, I think so. |
3f1831a
to
bf676b2
Compare
I've refreshed this.The way this PR proposes to fix the issue makes perfect sense but it doesn't work yet. The scroll calculation seems to be off and also the effect is ran once even after the scroll is set. Now we also have a hook |
Thank you @draganescu 👍
How does it propose to fix it? It isn't clear from the description. Would you be able to update that with any knowledge you gleaned from the code?
That's a shame. Do you think this route is the best option for fixing this bug. To me it's a pretty important Issue to get fixed. |
@getdave updated the description.
It makes sense - we have the correct scroll position when the user initiates the exit, we just need to apply it to the new situation. Another option is to simply scroll into view the current selection. |
It seems like this also needs to take the frame spacing into account in its scale calculation much like #65998. |
Perhaps my findings while testing are related to this not perfect, but I noticed that the zoom doesn't always display the correct section. My selected block was in frame only half of the time. |
What?
When toggling zoom out, we should maintain the scroll position to the currently visible content.
It's not perfect, but better than trunk.
Closes #65884
Why?
Because it's disorienting be scrolled to the top when zoomed in, given the intent of the double click is to edit the section which was just in view before double click,
How?
Try to compute scroll position after the zoom out is exited getting the previous scale and scroll and applying them to the new scale.
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
zoom-in-maintain-scroll.mp4