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

Support an anchor index #596

Open
rostero1 opened this issue Jan 5, 2025 · 0 comments
Open

Support an anchor index #596

rostero1 opened this issue Jan 5, 2025 · 0 comments

Comments

@rostero1
Copy link

rostero1 commented Jan 5, 2025

Is your feature request related to a problem? Please describe.

Discord chat has a concept of an anchor. If a user scrolls up to a message it will set one of the messages in view to be the anchor. The result is that any contents above or below the anchor that have layout shift, such as someone deleting a message or an image loading on a slow connection, will not affect the scroll position of the anchored item. This could be helpful for keyboard focus too, but I haven't investigated into that.

Describe the solution you'd like

An anchorId prop.

Describe alternatives you've considered

I have not tried anything, but this maybe could be solved with my own resize observer, but I'm afraid I'm scrolling after virtua is scrolling. Or something is happening too late.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant