From 6de4ad3ac42a479fbd9e7982dbc05aee872aae94 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Mon, 14 Sep 2020 20:53:11 -0400 Subject: [PATCH] ensure disabled form inputs are reset after browser navigation --- assets/js/ujs.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/assets/js/ujs.js b/assets/js/ujs.js index f869dfcb..952314d3 100644 --- a/assets/js/ujs.js +++ b/assets/js/ujs.js @@ -104,3 +104,7 @@ delegate(document, 'submit', { delegate(document, 'reset', { form: formReset }); + +window.addEventListener('pageshow', () => { + [].forEach.call(document.forms, form => formReset(null, form)); +});