Skip to content

Conversation

aksargus
Copy link

This PR improves the react-native-bottom-sheet behavior by adding two key enhancements:

Trigger onAnimate even when snapping to the same index

Previously, onAnimate only fired when the sheet snapped to a new index.

Now, with the new enableSameSnapIndexOnAnimate prop, onAnimate is called even if the target index is the same as the current index.

This allows developers to respond to repeated snaps to the same position, improving flexibility for UI updates or callbacks.

Usage Example:
<BottomSheet
enableSameSnapIndexOnAnimate={true}
onAnimate={(fromIndex, toIndex, fromPosition) => {
if (fromPosition < -40) {
console.log("Over-drag detected, refreshing!");
handleRefresh();
}
}}
/>

Benefits:

More consistent onAnimate behavior.

@aksargus aksargus closed this Sep 25, 2025
@aksargus aksargus reopened this Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant