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

Create 6845-add-a-parameter-for-scroll-speed.md #757

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AndriyFedorovich
Copy link

@AndriyFedorovich AndriyFedorovich commented Jan 30, 2024

This MR is a proposition to implement a parameter for scroll speed animation in methods like scrollTo

animated?: boolean;
viewOffset?: number;
viewPosition?: number;
speed?: number; // new value
Copy link
Author

Choose a reason for hiding this comment

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

Press ❤️ if you support


Usage of FlatList scrollToIndex function with an animation speed parameter improves the developers' experience

## Detailed design

Choose a reason for hiding this comment

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

I think on iOS this can be achieved pretty easily using animateWithDuration.

I've modified the code of RCTScrollView with this snippet and it works. I think providing a native way of handling this will be really nice addition to the Framework:

[UIView animateWithDuration:10.0f delay:0 options:UIViewAnimationOptionCurveLinear animations:^{
      self->_scrollView.contentOffset = offset;
    } completion:NULL];

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