Skip to content

Conversation

nstepien
Copy link
Collaborator

@nstepien nstepien commented Nov 2, 2020

scroll-behavior: smooth; made all scrolling smooth, including keyboard navigation, which is probably not desirable, especially when holding arrow keys.
I've made it so only scrollToRow is smooth.

@nstepien nstepien requested a review from amanmahajan7 November 2, 2020 13:44
@nstepien nstepien self-assigned this Nov 2, 2020
const { current } = gridRef;
if (!current) return;
current.scrollTop = rowIdx * rowHeight;
current.scrollTo({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it work in safari
https://caniuse.com/?search=scrollTo

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://developer.mozilla.org/en-US/docs/Web/API/ScrollToOptions
ScrollToOptions is supported, but the smooth option isn't supported yet so it'll be ignored.

Last modified: Aug 21, 2019

The mdn page hasn't been updated for over a year so it's probably safe to use this.

@amanmahajan7 amanmahajan7 merged commit d6866c9 into canary Nov 2, 2020
@amanmahajan7 amanmahajan7 deleted the smooth branch November 2, 2020 14:08
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

Successfully merging this pull request may close these issues.

2 participants