Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with changing urls and windows with pending modifications #247

Open
ghost opened this issue Aug 13, 2021 · 4 comments
Open

Problems with changing urls and windows with pending modifications #247

ghost opened this issue Aug 13, 2021 · 4 comments

Comments

@ghost
Copy link

ghost commented Aug 13, 2021

Hello,
Suppose I have a window with a form, that form has been modified, so the modifications are pending to be saved.
Now I open another window changing the url and therefore the current one (which has the modifications) closes, how can I put an alert message to prevent or accept navigating to the new url and accept or cancel the pending modifications in the current form?
I have tried to do it through the router.define handler, but it is not async.
Is there a standardized method to control this type of situation?
Thanks for your help.
Regards,
Jose

@ignertic
Copy link

I think this is something you can achieve in your code. Wherever you trigger the action to switch pages, why not have a modal or dialog show up first before you call Navigator.push

@ghost
Copy link
Author

ghost commented Sep 28, 2021

Thanks @ignertic,
but it is not that easy. :(
If the user changes the url in the browser to go to another page, I can't intercept it or at least I haven't found a way to do it.
Thanks.

@ignertic
Copy link

What are the ramifications if you try to achieve this with some javascript ?

@ghost
Copy link
Author

ghost commented Sep 29, 2021

I don't know, I am not an expert in javascript. :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant