-
Notifications
You must be signed in to change notification settings - Fork 18
Description
I'd love the ability to be able to run callbacks that trigger based on user's touch.. For example, for the onPressIn and onPressOut events, I'm trying to dynamically render a rating display UI Component based on when the user is actively rating / touching the component or not.. Unfortunately I can't do that with the current API it seems and wrapping it in a TouchableOpacity or other touch sensing component (TouchableWithoutFeedback), makes the component behave as if it were readonly..
My initial guess / intuition is that it looks like the highest level TouchableOpacity takes precedence over the lower ones.. Is there a way to insert a call back for those properties here that I'm missing, and if not, would it be difficult to pass down a callback into whatever component is capable of handling onPress events?
What I'm attempting to do:
<TouchableOpacity
activeOpacity={1}
onPressIn={() => setActivelyRating(true)}
onPressOut={() => setActivelyRating(false)}
>
<StarRatingBar
testID={testID}
starStyle={getStarStyles({ disabled, size, customSizes })}
readOnly={false}
dontShowScore
spacing={10}
valueToFix={1} // accuracy of decimals
continuous
score={+rating}
allowsHalfStars
accurateHalfStars
tintColor={getTintColor({ disabled })}
onStarValueChanged={val => handleStarChange(val)}
scoreTextStyle={getRatingTextStyle({ disabled, size })}
/>
</TouchableOpacity>