expo / react-native-action-sheet

A cross-platform ActionSheet for React Native
MIT License
1.4k stars 226 forks source link

Are we able to provide a callback to the cancel button? #263

Closed youngrichard closed 2 years ago

youngrichard commented 2 years ago

Since we do not define the action of the cancel button, is there any way we can supply a callback action to fire when the cancel button is pressed?

Thank you

bradbyte commented 2 years ago

@youngrichard what is the use case? It could be helpful when thinking of possible implementation. Thanks.

youngrichard commented 2 years ago

Our use case involves tracking user interactions, which we can do for the other buttons, but not cancel.

bradbyte commented 2 years ago

https://github.com/expo/react-native-action-sheet/blob/master/src/ActionSheet/index.tsx#L241-L242

I think this results in the onPress being called with the cancelIndex... is that not what you're seeing?