Open PashaArkus opened 5 years ago
This is a typical modal, so you wouldn't need to do anything more than this.$navigateBack()
, or following the docs from here if you $showModal: https://nativescript-vue.org/en/docs/routing/manual-routing/#showmodal
So it is, this is a standard modal window, but I cannot stop the standard behavior of the window when I press the back button. The window of simplicity closes, but I need it to not close.
I use the following code to listen to the back button event, but it works only after the user presses the back button when the window is already closed.
if (Platform.isAndroid) { application.android.on(AndroidApplication.activityBackPressedEvent, (data) => { data.cancel = true }); }
Shoot sorry! I totally read that as you wanted to close the modal. I tried something at one point.. let me see if I can find that in my code somewhere.
Shouldn't this issue be in the Nativescript core repo? Doesn't seem an issue with this plugin specifically.
We actually had a issue where we were using data.cancel = true
and it was preventing the closing of modals, so I'm not sure why it's behaving the other way around for you.
Hi all...
i'm currently facing the same problem as @PashaArkus. i setted the data.cancel = true
and won't prevent modal from closing.
hopefully if you guys want to add this feature, it will be very helpful for some cases. Especially when we need to focus our modal and prevent user from interacting anywhere else except our modal.
Is this issue reproducible without this plugin installed? If so, I'll close this issue and ask you to please open an issue in https://github.com/nativescript/nativescript
hi @edusperoni thanks for following up this issue...
i've tested without this plugin, an activityBackPressedEvent is triggered, and sets the data.cancel = true
will prevent modal from closing.
I'm using nativescript vue v2 and nativescript v 5.4.1
** reference: https://github.com/NativeScript/NativeScript/pull/6261
We've identified the issue and are working to fix it. We're also thinking about creating a separate showTransparentModal
instead of monkey-patching showModal
, so there might be a breaking change in the next version
I'm gonna looking forward for next version sir. Thank you @edusperoni
Thank you @edusperoni
@edusperoni longest time! Has this ever been fixed?
How to cancel / disable closing the modal window when you press the back button?
Which platform(s) does your issue occur on?
Android
Please, provide the following version numbers that your issue occurs with: