-
-
Notifications
You must be signed in to change notification settings - Fork 338
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
[REGRESSION] The onClick
function of <Pagination.Basic>
doesn't work
#676
Comments
I found a similar closed issue that might be relevant to your problem. The issue titled "Hi" was last updated on July 06, 2022. This issue was referenced by:
Regarding the regression introduced in commit To resolve this issue, you have a couple of options:
As a temporary workaround, you can use Here is an example of how you might wrap the <TouchableWithoutFeedback
key={index}
onPress={() => onPress?.(index)}
>
<View>
<PaginationItem
index={index}
size={size}
count={data.length}
dotStyle={dotStyle}
animValue={progress}
horizontal={!horizontal}
activeDotStyle={activeDotStyle}
>
{renderItem?.(item, index)}
</PaginationItem>
</View>
</TouchableWithoutFeedback> This should ensure that the |
As per Discord (here), @qwertychouskie - are you able to review the proposed fix here? |
f41173c introduced a regression where the
onClick
doesn't fire when clicking the dots of the<Pagination.Basic>
component.As per facebook/react-native#10180 (comment), the issue is that React Native's built-in
<TouchableWithoutFeedback>
needs the child to be a<View>
, not a custom component. Either revert the offending commit, or wrap the<PaginationItem>
in a<View>
.Oddly enough,
<Pagination.Custom>
still imports<TouchableWithoutFeedback>
fromreact-native-gesture-handler
, and therefore using<Pagination.Custom>
is a viable workaround for now.The text was updated successfully, but these errors were encountered: