sean2078
sean2078

Reputation: 5460

How to allow touches in React Native when a ScrollView is scrolling?

Given a View in React Native that renders a ScrollView with multiple TouchableHighlight controls, how can touches on a TouchableHighlight be allowed if the user has initiated a scroll ( contents within the ScrollView are in motion )?

Currently, the touch is handled by the ScrollView and is considered a "stop event" wherein the ScrollView stops its scrolling operation. Which is natural since that's a common way in which users stop a scroll in progress. However I'd like to be able to change this behavior and allow and/or detect the touch event while the ScrollView content is in motion.

Upvotes: 2

Views: 4490

Answers (1)

Daniel Schmidt
Daniel Schmidt

Reputation: 11921

There is no built-in solution for that, as far as I know. You may try to set the onMoveShouldSetResponderCapture property on the ScrollView, that may work.

Upvotes: 1

Related Questions