We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0071b61 commit 43ec771Copy full SHA for 43ec771
src/unfold/static/unfold/js/app.js
@@ -39,11 +39,17 @@ const warnWithoutSaving = () => {
39
40
checkFormChanged();
41
42
- window.addEventListener("beforeunload", (e) => {
+ preventLeaving = (e) => {
43
if (formChanged) {
44
e.preventDefault();
45
}
46
+ };
47
+
48
+ form.addEventListener("submit", (e) => {
49
+ window.removeEventListener("beforeunload", preventLeaving);
50
});
51
52
+ window.addEventListener("beforeunload", preventLeaving);
53
};
54
55
/*************************************************************
0 commit comments