On android device toast is draggable and after drag and drop, toast does not getting hide
See original GitHub issueI have followed the steps mention here https://www.npmjs.com/package/react-native-toast-message to add toast in my app. And I have followed code to display and hide the toast automatically after 2sec.
Toast.show({ text1: 'Submitted', type: 'success', visibilityTime: 2000, autoHide: true, position: 'top', topOffset: 10, onPress: () => { Toast.hide(); }, });
But when toast displayed, it is draggable, after drag and drop it is not getting hide and visibilityTime
is also not working in this case. This is specifically on android device.
Is there any way to remove draggable behaviour of toast?.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Drag and drop - Android Developers
The system responds by first calling back to your application to get a drag shadow. The system then displays the drag shadow on...
Read more >Android: Draggable Toast, Or Alternative? - Stack Overflow
The problem with using Toast is that I have to give it a duration, and, also, I can't change its position once it...
Read more >Android Drag and Drop Tutorial: Moving Views and Data
Android's drag -and-drop framework lets users move data and views using graphical gestures. Users can drag and drop data across views within ...
Read more >Gestures and Touch Events | CodePath Android Cliffnotes
First, we want to attach an onTouch handler on the views that are draggable which will start the drag by creating a DragShadow...
Read more >SureLock for Android User Guide - Documentation - 42Gears
of the document shall not be used, copied, altered, published, ... Set Custom Toast Message ... Download and install SureLock on your Android...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For some reason, I can’t even make it work on Android. iOS works just fine. However, I see getting this “Possible Unhandled Promise Rejection” error. 😦
this is a temporary fix in
node_modules/react-native-toast-message/src/index.js
you can comment this:
{...this.panResponder.panHandlers}
it will fix the issue but also disabled drag-to-close of toast
after that you can patch this change using
npx patch-package react-native-toast-message
just remember for ios to apply changes: 1- delete ios/Pods folder 2- runnpx patch-package
3- runnpx pod-install