-
Notifications
You must be signed in to change notification settings - Fork 98
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
Implement warning when leaving an unsubmitted form #1310
Conversation
@jotoeri any ideas why the custom message isn't shown in the window.confirm() dialog? |
Seems like just forms/src/components/AppNavigationForm.vue Line 207 in 6c257ed
|
@jotoeri Tried it with just confirm() but doesn't work either... Even with static text. Did just research and it seems that it doesn't accept custom text for the onbeforeunload event |
75f75bf
to
75b3a43
Compare
a65702b
to
09cb5a2
Compare
e67b140
to
2eac9cf
Compare
2eac9cf
to
4bccba8
Compare
Ok, sorry @Chartman123 i checked it once before quickly, but i definitely have not time to get into detail currently. Needs probably to be postponed. |
No problem, I think the design parts are more important for 3.0 than this here :) |
4bccba8
to
a8516e8
Compare
a8516e8
to
1abfb4e
Compare
ef5474f
to
5b953aa
Compare
5b953aa
to
eb776a2
Compare
eb776a2
to
ac283cf
Compare
ac283cf
to
c05f9e2
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently every time you open the submit view a confirmation dialog is shown, see code comment.
Moreover if you click to stay on the site, an error is thrown in the console because the navigation gets canceled (as requested) by the navigation guard.
So we should add a catch block to the router.push
calls on the TopBar
component and ignore every navigation guard related errors.
@susnux Thanks for your input :) I'm also planning to move the warning to a modal. If you want, you can help me there. Everytime I tried it ended up being even worse 😆 |
8cb813f
to
a23c6dd
Compare
4162781
to
7f7f2ad
Compare
19613b9
to
c3cddcd
Compare
c3cddcd
to
4d0c23f
Compare
5bed89a
to
4a45821
Compare
4a45821
to
ae8410d
Compare
Signed-off-by: Christian Hartmann <chris-hartmann@gmx.de>
d0e0316
to
4e636c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works now perfectly!
Fixes #319 by adding a warning
Signed-off-by: Christian Hartmann chris-hartmann@gmx.de