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

fix: swipe between child and parent TabNavigator #881

Merged
merged 8 commits into from
Jan 11, 2020

Conversation

computerjazz
Copy link
Contributor

@computerjazz computerjazz commented Sep 17, 2019

  • Cancels Gesture when swiping past either end of routes, which allows parent PanGestureHandler to become the gesture handler.
  • Provides context-based mechanism for child PanGestureHandlers to pass their refs up to the parent in order to use in simultaneousHandlers and waitFor props.

Motivation

Fixes #880

Test plan

  • Create nested tab navigator. Verify that swipes on the child, swipes on the parent, and swipes between child and parent all behave as expected.

panfix

@Gokaysim
Copy link

unfortunately, I had some issue. I have added PR with yarn add then it fails when app fetches file

/react-native-tab-view/package.jsonwas successfully found. However, this package itself specifies amain module field that could not be resolved (/react-native-tab-view/lib/module/index.js`. Indeed, none of these files exist:

@computerjazz
Copy link
Contributor Author

I think you need to build first, which generates lib.
https://github.com/react-native-community/react-native-tab-view/blob/master/package.json#L20

@satya164 satya164 requested a review from osdnk September 17, 2019 16:16
@computerjazz
Copy link
Contributor Author

@satya164 any updates on this? I've been patching this library with these changes in order for nested tab swiping to work.

@theisgroenbech
Copy link

I would love to have this merged :)

@neverlist
Copy link

I need this

});
};

// Cancel gesture if swiping back from initial tab or forward from last tab.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// Cancel gesture if swiping back from initial tab or forward from last tab.
// Cancel gesture if swiping back from the initial tab or forward from the last tab.

};

// Cancel gesture if swiping back from initial tab or forward from last tab.
// Enables parent Pager to pick up the gesture, if one exists.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// Enables parent Pager to pick up the gesture, if one exists.
// Enables parent Pager to pick up the gesture if one exists.

@osdnk osdnk changed the title [Pager] Fix swipe between child and parent TabNavigator fix: swipe between child and parent TabNavigator Jan 11, 2020
@osdnk osdnk merged commit b7e1ede into satya164:master Jan 11, 2020
gorhom added a commit to gorhom/react-native-tab-view that referenced this pull request Apr 1, 2020
* master:
  feat: export TabBarIndicator (satya164#962)
  chore: fix workflows
  chore: release 2.13.0
  chore: add workflow for publishing expo app
  chore: upgrade depenendecies
  fix: wrap tabview with gesture handler wrapper
  chore: update @types/react-native and remove TODO (satya164#956)
  feat: add InteractionHandle (satya164#905)
  chore: release 2.12.0
  docs: add docs for ScrollPager (satya164#954)
  feat: add support for web in the example (satya164#948)
  feat: conditionally add scrollView on iOS instead of pager (satya164#952)
  feat: expose TabView and TabBar Props (satya164#941)
  fix: typos in comments
  fix: swipe between child and parent TabNavigator (satya164#881)
  chore: optimize images (satya164#946)
  docs: update Quick Start example with 0 index state (satya164#937)
  chore: upgrade expo to sdk 36
  docs: use hooks for the example code
  docs: add info about usage with other libraries
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gestures don't work on parent Navigator when TabNavigators are nested
5 participants