Skip to content
This repository has been archived by the owner on Nov 27, 2022. It is now read-only.

index in navigationState is ignored #1395

Open
2 of 5 tasks
jurisjansons opened this issue Oct 3, 2022 · 2 comments
Open
2 of 5 tasks

index in navigationState is ignored #1395

jurisjansons opened this issue Oct 3, 2022 · 2 comments

Comments

@jurisjansons
Copy link

Current behavior

index parameter in navigationState is ignored. You can swipe and change tab even when index is set to constant value.

Expected behavior

TabView is showing tab with given index

as from documentation:

onIndexChange (required)
Callback which is called on tab change, receives the index of the new tab as argument. The navigation state needs to be updated when it's called, otherwise the change is dropped.

so, preventing index chande sould result in preventing tab switch

Reproduction

https://snack.expo.dev/CV5lqoORhN

Platform

  • Android
  • iOS
  • Web
  • Windows
  • MacOS

Environment

package version
react-native-tab-view 3.2.1
react-native-pager-view 5.4.24
react-native 0.69.5
expo 46.0.0
node 14.17.2
npm or yarn 8.11.0
@github-actions
Copy link

github-actions bot commented Oct 3, 2022

The versions mentioned in the issue for the following packages differ from the latest versions on npm:

  • react-native-pager-view (found: 5.4.24, latest: 6.0.0)
  • react-native (found: 0.69.5, latest: 0.70.1)
  • expo (found: 46.0.0, latest: 46.0.14)

Can you verify that the issue still exists after upgrading to the latest versions of these packages?

@satya164
Copy link
Owner

satya164 commented Oct 3, 2022

Yeah, this is a bug. PRs welcome to fix it!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants