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

Notify the user about form data loss when another document is opened #12257

Closed
timvandermeij opened this issue Aug 21, 2020 · 2 comments · Fixed by #13175
Closed

Notify the user about form data loss when another document is opened #12257

timvandermeij opened this issue Aug 21, 2020 · 2 comments · Fixed by #13175

Comments

@timvandermeij
Copy link
Contributor

Since #12241 we have notifications for this when the user navigates away from the viewer, but we do not yet warn when switching documents, which means that if you call e.g. PDFViewerApplication.open with a new document (or directly call BaseViewer.setDocument when using the viewer components standalone) there won't be any warning about losing form data. This should be addressed.

@Snuffleupagus
Copy link
Collaborator

Given that this obviously doesn't apply to the Firefox PDF Viewer, the idea of having to add a custom prompt (e.g. somewhat similar to the existing password prompt) and the associated logic doesn't feel all that great as far as I'm concerned.

Hence, taking a step back and considering that it's somewhat of an edge-case in the GENERIC viewer, considering that what we really want to avoid here is unexpected data loss in forms I'm wondering if we could perhaps "cheat" a bit here:
What if we simply triggered a normal save dialog automatically, from within the PDFViewerApplication.close method, when modified form data exists (assuming that'd actually work, given how the GENERIC DownloadManager works)?

@timvandermeij
Copy link
Contributor Author

I think that would also be fine. The intention is indeed to avoid unexpected data loss, so prompting the user to save the form would also suffice I think.

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