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

User should be able to set where a scrollview rests when scrolling to next step #278

Open
jakequade opened this issue Mar 31, 2023 · 1 comment

Comments

@jakequade
Copy link
Contributor

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

Scrollview doesn't currently allow the user to dictate where on the screen an element within a scrollview should display. It defaults to the middle of the screen

Describe the solution you'd like

A prop that can be passed to the step component that determines the scrollTo function params for the given step.

See:

const yOffset = y > 0 ? y - h / 2 : 0;
scrollView.scrollTo({ y: yOffset, animated: false });

A simple solve could be allowing the user to pass in this offset value per-step.

Describe alternatives you've considered

  • Interacting with the scrollRef before calling handleNext so that it's scrolled into location without any library changes. This doesn't work as the scrollview is reset by the library.
  • The library doesn't manipulate the scrollview outside of finding nodes / steps, so the user could manually call scroll functions before handleNext.

Teachability, Documentation, Adoption, Migration Strategy

Happy to raise a PR with some documentation + implementation if it's of use.

@mohebifar
Copy link
Owner

Happy to raise a PR with some documentation + implementation if it's of use.

@jakequade A PR would be much appreciated!

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

2 participants