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

warning the user if he tries to close the page (or navigate away) #474

Open
teolemon opened this issue Mar 28, 2024 · 2 comments
Open

warning the user if he tries to close the page (or navigate away) #474

teolemon opened this issue Mar 28, 2024 · 2 comments

Comments

@teolemon
Copy link
Member

          The loss of changes is however a big deal @perierc 

As we have hasChanges I think there is a way to handle that by warning the user if he tries to close the page (or navigate away):
see https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event

It might be in another PR though.

Originally posted by @alexgarel in #468 (comment)

@aapatil2004
Copy link

Can i work on this issue

aapatil2004 added a commit to aapatil2004/taxonomy-editor that referenced this issue Dec 14, 2024
aapatil2004 added a commit to aapatil2004/taxonomy-editor that referenced this issue Dec 18, 2024
@alexgarel
Copy link
Member

Just to be precise, as reported on the PR, navigate away means:

  1. either closing the tab and / or typing / clicking a new external url
  2. either navigating to another page of the app.

While the first might be solved with beforeunload_event,
The second needs to be handled in React routing (because the page does not really change from the browser point of view).

aapatil2004 added a commit to aapatil2004/taxonomy-editor that referenced this issue Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

3 participants