react-native-toast-message icon indicating copy to clipboard operation
react-native-toast-message copied to clipboard

Disable OnPress / Gestures

Open brandrewsATG opened this issue 4 years ago • 10 comments
trafficstars

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!

brandrewsATG avatar Feb 24 '21 17:02 brandrewsATG

Hi, onPress does nothing by default. As for the swipe gesture, not possible to disable it at this point

calintamas avatar Feb 25 '21 14:02 calintamas

Thanks for your reply!

brandrewsATG avatar Feb 25 '21 15:02 brandrewsATG

@brandrewsATG You can use this fork version to disable the swipe gesture: https://github.com/tientran0019/react-native-toast-message

tientran0019 avatar Jun 09 '21 10:06 tientran0019

@brandrewsATG You can use this fork version to disable the swipe gesture: https://github.com/tientran0019/react-native-toast-message

Wow! Thanks @tientran0019 !

brandrewsATG avatar Jun 09 '21 13:06 brandrewsATG

👋 Has this feature been implemented? Or do I still have to use the fork for that?

RWOverdijk avatar Mar 10 '22 09:03 RWOverdijk

👋 Has this feature been implemented? Or do I still have to use the fork for that?

Hi @calintamas, same question. (is this feature implemented.)

siddharth-kt avatar Mar 14 '22 18:03 siddharth-kt

Hey, unfortunately, not yet. I'll try in the next couple of days, or the latest during the weekend

calintamas avatar Mar 14 '22 19:03 calintamas

Thanks @calintamas, I will be waiting...

siddharth-kt avatar Mar 14 '22 19:03 siddharth-kt

this would be nice to have

stepas-dev avatar Apr 11 '22 12:04 stepas-dev

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.

MagicAce1988 avatar Jun 19 '22 09:06 MagicAce1988