I have TouchableOpacity rendered inside the row item of Flatlist. I wanted to show a click effect when user click on the item. However, the click effect also triggered when user start scrolling. How can I disable the highlighting effect when user is scrolling?
Asked
Active
Viewed 1,232 times
6
-
1can you try `TouchableWithoutFeedback` with `delayPressIn` prop instead of `TouchableOpacity` – Aravind S Jul 31 '18 at 09:40
-
1with delayPressIn, I can somehow disable the highlighting effect when scrolling, but when I click on the item, item won't be highlighted immediately due to the delay.. so I guess it is not the optimum solution.. – Zhen Jing Heng Jul 31 '18 at 10:10
-
That can be tweaked by changing the `delayPressIn` value i guess. What value you given? – Aravind S Jul 31 '18 at 10:26
-
I was setting to 50 – Zhen Jing Heng Jul 31 '18 at 11:01
-
try some low value as see because scroll touch on screen wont last long – Aravind S Jul 31 '18 at 11:02
-
1a tap on the screen is fast enough as well.. so setting a lower delay time doesn't solve the issue – Zhen Jing Heng Jul 31 '18 at 12:43
-
I have the same issue .. – Rasmus Styrk Jan 13 '19 at 15:12
-
1Possible duplicate of [How to disable highlighting effect of TouchableOpacity when scrolling?](https://stackoverflow.com/questions/52421283/how-to-disable-highlighting-effect-of-touchableopacity-when-scrolling) – Francois Nadeau Jun 03 '19 at 14:14