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

Bug: Navigating away from editors without saving loses changes #1389

Open
jmakowski1123 opened this issue Oct 16, 2024 · 4 comments
Open

Bug: Navigating away from editors without saving loses changes #1389

jmakowski1123 opened this issue Oct 16, 2024 · 4 comments
Assignees
Labels
bug Report of or fix for something that isn't working as intended high

Comments

@jmakowski1123
Copy link

Reloading or otherwise using browser controls to navigate to another page loses unsaved changes with no confirmation. Can we intercept that event and warn the user they may lose unsaved changes in that case?

@jmakowski1123 jmakowski1123 converted this from a draft issue Oct 16, 2024
@navinkarkera navinkarkera self-assigned this Oct 25, 2024
@bradenmacdonald bradenmacdonald added the bug Report of or fix for something that isn't working as intended label Oct 31, 2024
@pomegranited pomegranited moved this from In Progress to Ready for AC testing in Libraries Overhaul Nov 7, 2024
@pomegranited
Copy link
Contributor

@jmakowski1123 @lizc577 @sdaitzman @marcotuts This is ready for AC testing on the sandbox

@jmakowski1123
Copy link
Author

This is working as intended.

When I opt to reload a page with the editor open from my browser, the reload takes me back to the library homepage, rather than keeping the editor modal open. Is that intended? I would expect that the editor would stay open?

@navinkarkera
Copy link
Contributor

@jmakowski1123 Again apologies for not including the limitations of the implementation here.

As mentioned in #1444, there are some limitations while blocking users from navigating away for editors like react-router not preserving the state and browsers not emitting the unload event in some cases.

When I opt to reload a page with the editor open from my browser, the reload takes me back to the library homepage, rather than keeping the editor modal open. Is that intended? I would expect that the editor would stay open?

Currently, this is the intended behaviour as we are not preserving the editor state before save. But it should be possible for us to reopen the editor on refresh if required. cc: @bradenmacdonald

I also believe that it would be much better experience to preserve the editor state in localstorage and restore from it on refresh instead of blocking user but it is not simple to implement.

@ChrisChV
Copy link
Contributor

@jmakowski1123 Is it okay to move it to Done?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Report of or fix for something that isn't working as intended high
Projects
Status: Ready for AC testing
Development

No branches or pull requests

5 participants