question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Conflict with TouchableOpacity / TouchableWithoutFeedback...

See original GitHub issue

When using any Touchable component (instead of <View>) as the row container, the re-ordering doesn’t work.

<Animated.TouchableOpacity style={[
        styles.row,
        this.state.style,
      ]}>
      <Image source={{uri: data.image}} style={styles.image} />
      <Text style={styles.text}>{data.text}</Text>
</Animated.TouchableOpacity>

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
harrisonturtoncommented, Dec 19, 2017

I’ve run into this issue – TouchableOpacity causes the re-ordering functionality to fail. My code:

<SortableList
     data={this.state.data}
     renderRow={({ data, active }) => {
         return (
             <TouchableOpacity style={styles.card}>
                 <Text>Row</Text>
             </TouchableOpacity>
         );
     }}
/>

When I change TouchableOpacity into View it works fine.

0reactions
mkhizeralicommented, Jan 8, 2019

I’m also facing same issue. Have to go through with the whole idempotent logic including revamp of handling click events in parent container. would be hugely appreciable of someone to add please status or pull request.

Read more comments on GitHub >

github_iconTop Results From Across the Web

touchableWithoutFeedback onPress and onPressOut not firing ...
I found the following did not work with TouchableWithoutFeedback but is working with TouchableOpacity on React Native 0.37.0:.
Read more >
React Native Touchable is disabling ScrollView - Stack Overflow
You can have a scrollView or FlatList inside a TouchableWithoutFeedback. ... or the simplest way is to add a TouchableOpacity around Text in...
Read more >
TouchableWithoutFeedback - React Native
Importantly, TouchableWithoutFeedback works by cloning its child and applying responder props to it. It is therefore required that any ...
Read more >
React Native touchable vs. pressable components
The TouchableOpacity and TouchableHighlight components can each inherit several shared props from the TouchableWithoutFeedback component ...
Read more >
Pressable vs. Touchable in React Native | by MahYar - Medium
Touchable components are: Button. 2. TouchableWithoutFeedback. 3. TouchableHighlight. 4. TouchableOpacity. 5. TouchableNativeFeedback. Pressable ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found