react-native-tab-view icon indicating copy to clipboard operation
react-native-tab-view copied to clipboard

Swipe slider inside child view of TabViewAnimated also make tab scroll and changed

Open mtr1012 opened this issue 8 years ago • 7 comments

I have TabViewAnimated and some childs component inside it. Every child have slider inside. Everytime i swipe the slider, it make tab also scroll and changed. I want to swipe only the slider and not make tab scroll. Anyone please help.

Many thanks !

mtr1012 avatar May 16 '18 08:05 mtr1012

You should study about panresponder first, and understand how react Native capture event.

Just example, try to make scrollview on scrollview, and try panresponder with that

never00miss avatar May 21 '18 19:05 never00miss

@mtr1012 Have you solved it? I have the same question for rendering slider in react native tab view, cannot slide any more.

kidmysoul avatar Jun 22 '18 03:06 kidmysoul

@mtr1012 and @kidmysoul Did you resolve it? I have the same issue in iOS: When moving the slider the whole tab scrolls. Doesn't happen in Android.

sarykemmoun avatar Jul 11 '18 08:07 sarykemmoun

@sarykemmoun No,I did not resolve it.I decided not use this library any more.At the end I make several view components by my self.

kidmysoul avatar Jul 11 '18 23:07 kidmysoul

For everybody who needs: Finally, I've solved it by a workaround. I set the TabViewAnimated props of swipe to be depends on the state and changed the state when swiping the slider. See the code below:

<TabViewAnimated
     ...
     animationEnabled={this.state.allowScroll}
     swipeEnabled={this.state.allowScroll}        
/>
<Slider
   ...
   onValuesChangeStart={()=>  { this.setState({allowScroll: false}); }}
   onValuesChangeFinish={() => { this.setState({allowScroll: true}); }}
 />               

sarykemmoun avatar Jul 12 '18 12:07 sarykemmoun

Hey, I just released a new alpha 2.0.0-alpha.0 of the library. It's rewritten using react-native-gesture-handler and react-native-reanimated addresses a many platform specific bugs and performance problems. The documentation is updated as well.

Please try the new version and see if it addresses your issue. If not, please open a new issue following the issue template.

satya164 avatar Feb 19 '19 22:02 satya164

I had a similar issue and upgrading to 2.2.1 solved it.

naorzr avatar May 15 '19 12:05 naorzr