mohebifar / mohebifar/react-native-copilot

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

Open
#278 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.4k
Forks
428
PR merge metrics
No merged PRs in 30d

Description

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: https://github.com/mohebifar/react-native-copilot/blob/021f9c49747b298c2a1e531a305ca8f50726e039/src/contexts/CopilotProvider.tsx#L111-L112

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/contexts/CopilotProvider.tsx at the scrollTo call referenced in the issue, then trace how step props are defined and passed to the step component. Add a per-step value that controls the scrollTo parameters, and update the documentation so users can configure where the target rests when advancing to the next step.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
mobile
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.