-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Touchable elements within FlatList / SectionList not registering #14155
Comments
I too am having trouble getting touchable elements to work with FlatList. In particular, TextInput Edit - Solution: My problem was that my TextInput didn't have a height so there was nothing to tap on, add a height to your TouchableHighlight to see if that makes a difference |
same problem here too. Have you found the soln? |
1 similar comment
same problem here too. Have you found the soln? |
This solution helped me: #13649 |
Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally! If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:
If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution. |
I recommend u to use ListItem: for more information : https://react-native-training.github.io/react-native-elements/docs/listitem.html |
Hi
This is basically how you do. You set onPress to null at outmost wrapper. Then you set to whatever you want to cllick. onPressRecom is my local function. It worked on me as the log appears correct. It seems that the flatlist renderItem function will render many times, and each time it renders it automatically trigger the touch event. Making it more confusing, after it finishes rendering, click on the touch event, nothing will work. Hmmm... anyways, this hacky way worked for me. I do not know why though. Besides, I tried to follow flatlist example from https://facebook.github.io/react-native/docs/flatlist, follow "multi-select example" using pure component. Let me know if you have proper way of doing it. |
@pull-bot: Certainly, the issue has not been fixed in a recent release and perhaps it is affecting a lot of people. 😀 |
Description
For some reason, Touchable* elements within a FlatList or SectionList view, do not register touches. Rather, it seems that upon rendering a FlatList, a touch event immediately occurs.
Reproduction Steps and Sample Code
The following, upon render, will produce an alert, "Touched". This should not happen, only on element touch. Furthermore, you cannot touch the TouchableHighlight element and have an alert popup (no highlight colours, nothing).
Solution
Make elements touchable within FlatList (and SectionList, which exhibits the same behaviour).
Additional Information
react-native run-android
The text was updated successfully, but these errors were encountered: