Skip to content
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

When using scrollIntoView, smooth scrolling is very fragile and easy to interrupt #60

Open
Inwerpsel opened this issue Feb 14, 2024 · 1 comment
Labels
bug Something isn't working impact:low The feature/bug has only a low impact

Comments

@Inwerpsel
Copy link
Owner

Inwerpsel commented Feb 14, 2024

If you travel through history fast enough (not even that fast), it will interrupt certain smooth scrolls in the frame, leaving the position somewhere along the way to the element.

As a result, the history timeline is already not using smooth because this issue happened too much.

When scrolling the inspected element into view, it seems to get interrupted by scrolling (in a slightly later history step) an element into view inside another parent. This might be a bug in the browser (tested only Chromium) and is unfortunate at least.

For example, if you first scroll past a step that focuses an element inside the app frame, and then to a next step which scrolls a section of the inspector into view, then the scrolling in the app frame gets stopped along the way.

It only seems to happen for scrollIntoView. The sidebar has similar functionality, except it uses a stored integer offset. This seems to end up on the right position regardless of any later events.

If 2 separate elements like this are scrolled into view at the same time (so in a single history step), there's no problem.

@Inwerpsel Inwerpsel added bug Something isn't working impact:high The feature/bug has a particularly high impact labels Feb 14, 2024
@Inwerpsel Inwerpsel changed the title Smooth scrolling into view is very fragile and easy to interrupt When using scrollIntoView, smooth scrolling is very fragile and easy to interrupt Feb 15, 2024
@Inwerpsel Inwerpsel removed the impact:high The feature/bug has a particularly high impact label Mar 24, 2024
@Inwerpsel
Copy link
Owner Author

Smooth scrolling is now only used a in a few places anymore where it's unlikely to get interrupted.

For most purposes, instant scrolling actually turned out to feel smoother than multiple consecutive smooth scrolls.

@Inwerpsel Inwerpsel added the impact:low The feature/bug has only a low impact label Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working impact:low The feature/bug has only a low impact
Projects
None yet
Development

No branches or pull requests

1 participant