-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix: scrollIntoView should respect scroll-margin #8715
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
Thanks for the PR, could you add any storybook examples or can you describe what stories to use in testing? |
@snowystinger Added two stories 👍 You can test for For PS: We should consider changing every occurence of |
I'm not able to reproduce this one with that story and reverting the changes in scrollIntoView? Am I doing something wrong? Tried in both Chrome and Safari
I didn't notice a difference in this one either in chrome or safari? I feel like I must be doing something wrong here. |
@snowystinger This is what the Screen.Recording.2025-08-21.at.6.55.43.AM.movEdit: I think I know why the grid appears normal for you after reverting to main. You need to make sure still to include the Additionally, I just found another issue in FireFox & Safari, which do not scroll items to their proper alignment on native Screen.Recording.2025-08-21.at.7.59.12.AM.mov |
Closes #8689
This PR adds scroll-margin adherence to our
scrollIntoView
shim. It also fixessmooth
scrolling when offset is mutated bidirectionally by using nativescrollTo()
.✅ Pull Request Checklist:
📝 Test Instructions:
🧢 Your Project: