Skip to content

Commit

Permalink
Merge pull request #33878 from dimagi/smh/clear-from-submit-on-nav
Browse files Browse the repository at this point in the history
Form submit button: Add check for document.visibilityState
  • Loading branch information
stephherbers committed Dec 15, 2023
2 parents f77ae77 + b2a909a commit 7341be9
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,11 @@ hqDefine("cloudcare/js/form_entry/form_ui", function () {
});

self.submitForm = function () {
$(document).onvisibilitychange = () => {
if (document.visibilityState === "hidden") {
self.showSubmitButton = false;
}
};
self.hasSubmitAttempted(true);
$.publish('formplayer.' + constants.SUBMIT, self);
};
Expand Down

0 comments on commit 7341be9

Please sign in to comment.