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

TouchableWithoutFeedback prevents scrolling

Open MasoudShah opened this issue 4 years ago • 17 comments

I have multiple tabs inside ScrollableTabView and some of them are FlatLists. The items of FlatList are wrapped inside a TouchableWithoutFeedback with onPress property. Scrolling vertical (witch is FlatList responsible for) is OK and the FlatLists have no issue but the problem is scrolling horizontal (whitch is about scrolling between tabs). When you scroll horizontally on an Item of FlatList, scrolling wont happen and the onPress of TouchableWithoutFeedback triggers; but if your point of touch is not on the items and instead between them, it scrolls normally. The problem is scrolling horizontal doesn't steals the responder lock of TouchableWithoutFeedback. This problem happens only in scrolling from left to right and the opposite direction works well. How can I overcome this problem?

MasoudShah avatar Apr 10 '20 21:04 MasoudShah

Still no solution for this?

MasoudShah avatar Apr 28 '20 10:04 MasoudShah

I am having the same issue on Android. Works fine on iOS

pratham014 avatar May 06 '20 08:05 pratham014

I was able to resolve this issue by wrapping the FlatList inside GestureRecognizer from react-native-swipe-gestures. and ignore the gesture event returned by it.

pratham014 avatar May 06 '20 09:05 pratham014

I used react-native-tab-view witch solved my issue

MasoudShah avatar May 27 '20 05:05 MasoudShah

I used react-native-tab-view witch solved my issue

are you do not need scrollable tab bar? is react-native-tab-view have scrollable tab bar????

brambang avatar Jun 19 '20 10:06 brambang

I used react-native-tab-view witch solved my issue

are you do not need scrollable tab bar? is react-native-tab-view have scrollable tab bar????

Yes it has the scrollable tab bar

MasoudShah avatar Jun 23 '20 11:06 MasoudShah

import { TouchableNativeFeedback, TouchableHighlight, TouchableOpacity, TouchableWithoutFeedback } from 'react-native-gesture-handler'

I use react-native-gesture-handler instead solved the problem

zhugy-yami avatar Jul 01 '20 09:07 zhugy-yami

import { TouchableNativeFeedback, TouchableHighlight, TouchableOpacity, TouchableWithoutFeedback } from 'react-native-gesture-handler'

I use react-native-gesture-handler instead solved the problem

works good for me, thx

clwy-cn avatar Jul 07 '20 05:07 clwy-cn

import { TouchableNativeFeedback, TouchableHighlight, TouchableOpacity, TouchableWithoutFeedback } from 'react-native-gesture-handler' I use react-native-gesture-handler instead solved the problem

works good for me, thx

客气

zhugy-yami avatar Jul 07 '20 06:07 zhugy-yami

import { TouchableNativeFeedback, TouchableHighlight, TouchableOpacity, TouchableWithoutFeedback } from 'react-native-gesture-handler' 点击没效果,android 中MainActivity中增加

import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
...
 @Override
  protected ReactActivityDelegate createReactActivityDelegate() {
    return new ReactActivityDelegate(this, getMainComponentName()) {
      @Override
      protected ReactRootView createRootView() {
        return new RNGestureHandlerEnabledRootView(MainActivity.this);
      }
    };
  }

puxiaoshuai avatar Jul 23 '20 03:07 puxiaoshuai

scrollable

I don't think we can scroll header element in that. that's why we need a scrollable tab view. Isn't it?

AdarshJais avatar Aug 20 '20 08:08 AdarshJais

import { TouchableNativeFeedback, TouchableHighlight, TouchableOpacity, TouchableWithoutFeedback } from 'react-native-gesture-handler'

I use react-native-gesture-handler instead solved the problem

ridiculous, but it works🤪

erhanbicer avatar Aug 28 '20 12:08 erhanbicer

import { TouchableNativeFeedback, TouchableHighlight, TouchableOpacity, TouchableWithoutFeedback } from 'react-native-gesture-handler'

I use react-native-gesture-handler instead solved the problem

This doesn't work for me at all. Also the vertical scrolling isn't working when I have a flatlist inside touchableWithoutFeedback. Any updates on this one ?

m6265m avatar Mar 19 '21 08:03 m6265m

import { TouchableNativeFeedback, TouchableHighlight, TouchableOpacity, TouchableWithoutFeedback } from 'react-native-gesture-handler'

I use react-native-gesture-handler instead solved the problem

真是个天才....

edwards19900128 avatar Apr 09 '21 07:04 edwards19900128

Dear @MasoudShah, to scroll inside the TouchableWithoutFeedback, you need your each FlatList element to be in the TouchableView instead of View. You can write ... <TouchableView onPress={() => false} activeOpacity={1}> ... </TouchableView>

Thus, we get the usual View. This way you can scroll ScrollView or FlatList in the TouchableWithoutFeedback.

zohayk avatar May 13 '21 03:05 zohayk

In my case helped wrapping Flatlist renderItem component into TouchableOpacity

IFinesse avatar Jan 17 '22 13:01 IFinesse

<ScrollView keyboardShouldPersistTaps="always" keyboardDismissMode='on-drag'> {... scrollable elements} </ScrollView>

R-Art-project avatar Aug 15 '23 05:08 R-Art-project