react-native-toast-message
react-native-toast-message copied to clipboard
Disable OnPress / Gestures
Hello,
Is there anyway to disable the onpress / gesture that swipes the toast away? I'm using a custom toast if that makes any difference.
Thanks in advance for your response!
Hi, onPress does nothing by default. As for the swipe gesture, not possible to disable it at this point
Thanks for your reply!
@brandrewsATG You can use this fork version to disable the swipe gesture: https://github.com/tientran0019/react-native-toast-message
@brandrewsATG You can use this fork version to disable the swipe gesture: https://github.com/tientran0019/react-native-toast-message
Wow! Thanks @tientran0019 !
👋 Has this feature been implemented? Or do I still have to use the fork for that?
👋 Has this feature been implemented? Or do I still have to use the fork for that?
Hi @calintamas, same question. (is this feature implemented.)
Hey, unfortunately, not yet. I'll try in the next couple of days, or the latest during the weekend
Thanks @calintamas, I will be waiting...
this would be nice to have
I have a great solution that I figured out for my app as I needed for example for the toast message to not be dismissable when user is offline and app shows a notification about user being offline:
Wherever you have your Toast instance in your app surround it with a view like this:
<View
style={{width, height, position: 'absolute', pointerEvents: canInteract ? 'box-none' : 'none' }}>
<Toast config={toastConfig} ref={ref => Toast.setRef(ref)} />
</Box>
Then canInteract can be a piece of state at app level that you can change depending if you want the notification to be dismissable or not.