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

SegmentedControl can not update selected index programmatically #2880

Open
3 of 7 tasks
Relax594 opened this issue Jan 5, 2024 · 2 comments
Open
3 of 7 tasks

SegmentedControl can not update selected index programmatically #2880

Relax594 opened this issue Jan 5, 2024 · 2 comments
Labels
bug a bug in one of the components wontfix

Comments

@Relax594
Copy link

Relax594 commented Jan 5, 2024

Description

It looks like there is no property to update the current selected index programmatically. The intialIndex is only used once and updating it has no impact.

Related to

  • Components
  • Demo
  • Docs
  • Typings

Steps to reproduce

Expected behavior

Being able to update the selected index per code

Actual behavior

Can not update the selected index per code

More Info

Code snippet

Environment

  • React Native version: 0.71.14
  • React Native UI Lib version: 7.14.0

Affected platforms

  • Android
  • iOS
  • Web
@Relax594 Relax594 added the bug a bug in one of the components label Jan 5, 2024
@ethanshar
Copy link
Collaborator

Hi @Relax594
The SegmentedControl component is uncontrolled, meaning you don't need to pass the index back to it, it manages its own index.

You can reset it by passing a different initialIndex

Copy link

stale bot commented Jan 31, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug a bug in one of the components wontfix
Projects
None yet
Development

No branches or pull requests

2 participants