You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While his approach works fine, it is very much involved to get it working properly. In his case, you even need to add a native dependency to the project.
In my opinion, the whole UX can be almost achieved using existing RN components. Almost because I've been stuck with the inability to "hand over" a gesture to a specific responder.
If you could have a main gesture responder over your view to intercept touches, it could easily act as a switch for other pan responders in the layout.
You may argue that that's what the capture phase is here for with *ShouldSetPanResponder. And you're right! However, you can only use the capture phase properly if "deeper" pan responders are nested within the hierarchy of "higher" pan responders.
If I want to be able to swipe on the header view to control either one of the scrollviews, I have to resort using Animated ScrollViews and fiddle with custom pan handlers to interact with the lists below.
If I could simply redirect horizontal gestures to ScrollView H's pan responder, and vertical gestures to the active vertical ScrollView, I would benefit from a native feel and features like pull to refresh.
Again, if there is a way to make this work using currently existing features I'd gladly be proven wrong! If that's not the case, then I think this is a pretty justified feature request/discussion to have.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This idea came from a need that I have to build a component similar to this one: JungHsuan/react-native-collapsible-tabview.
While his approach works fine, it is very much involved to get it working properly. In his case, you even need to add a native dependency to the project.
In my opinion, the whole UX can be almost achieved using existing RN components. Almost because I've been stuck with the inability to "hand over" a gesture to a specific responder.
If you could have a main gesture responder over your view to intercept touches, it could easily act as a switch for other pan responders in the layout.
You may argue that that's what the capture phase is here for with
*ShouldSetPanResponder
. And you're right! However, you can only use the capture phase properly if "deeper" pan responders are nested within the hierarchy of "higher" pan responders.Take the following hierarchy for example:
If I want to be able to swipe on the header view to control either one of the scrollviews, I have to resort using Animated ScrollViews and fiddle with custom pan handlers to interact with the lists below.
If I could simply redirect horizontal gestures to ScrollView H's pan responder, and vertical gestures to the active vertical ScrollView, I would benefit from a native feel and features like pull to refresh.
Again, if there is a way to make this work using currently existing features I'd gladly be proven wrong! If that's not the case, then I think this is a pretty justified feature request/discussion to have.
Beta Was this translation helpful? Give feedback.
All reactions