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

Ignore page refresh event #133

Open
daughtkom opened this issue Dec 13, 2019 · 1 comment
Open

Ignore page refresh event #133

daughtkom opened this issue Dec 13, 2019 · 1 comment

Comments

@daughtkom
Copy link

I've got everything working perfectly with one exception. I am using the dialog (bootstrap, using recommended plugin), enabling/disabling submit buttons, etc. Everything is great.

Except... the browser's default beforeunload dialog is displayed on page refresh. I get why it's not showing the bootstrap dialog, but my preference is to have the refresh action (F5, Ctrl+R, etc) bypass all dirty checking entirely and simply refresh.

Is that an option? I'm still digging on my own, and have been for a while, but thought I'd post here to see if there's something easy I'm just missing. Is this possible?

@daughtkom
Copy link
Author

This is what I'm doing for now, but not sure if I'm losing anything else by doing it this

$("form#myform").dirtyForms({
// ...
});

$(window).unbind('beforeunload');
window.onbeforeunload = null;

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