Viewing a sutta on Sutta Central in Chrome, Edge, or Firefox on Windows 11 PC.
Current Behavior
When using the “V” keyboard shortcut to switch views, the page inconsistently saves where you were after fully cycling through the views. You can see this if you go to a sutta, scroll down to a certain point, make note of where you are, then press the “V” key to cycle through the views. When you come back to your original view, the page will sometimes be in the place where you were but other times be in a different place. The exception is the very top of the page, where it will consistently remember your place. Firefox seems to remember more consistently than Edge or Chrome.
Desired Behavior
If it isn’t an overly-laborious fix, have the page consistently remember where you were after cycling through the views.
My guess at the “fix” here would be on layout change to identify the segment currently in view using:
segments.forEach(s => {
const rect = s.getBoundingClientRect();
...
and then s.scrollTo() that segment after the layout shift is finished. @HongDa - How would one accomplish that? Surely lit redux has a cleaner way to execute a callback after a layout shift than to use setTimeout?