From 14fdc688e65b96ab3438e10ef119db017d3ba77a Mon Sep 17 00:00:00 2001 From: Montmorency Date: Mon, 30 Aug 2021 14:10:18 +0100 Subject: [PATCH] potential mod for create form actions to helpers.js so that it is the same with and without Turbolinks on Left branch from failed form submission. --- lib/IHP/static/helpers.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/IHP/static/helpers.js b/lib/IHP/static/helpers.js index 4ae03619c..828cb78bb 100644 --- a/lib/IHP/static/helpers.js +++ b/lib/IHP/static/helpers.js @@ -187,7 +187,9 @@ window.submitForm = function (form, possibleClickedButton) { ); transitionToNewPage(request.response); Turbolinks.clearCache(); - history.pushState({ turbolinks: true }, '', request.responseURL); + if (request.responseURL !== form.action) { + history.pushState({ turbolinks: true }, '', request.responseURL); + }; var turbolinkLoadEvent = new CustomEvent('turbolinks:load'); document.dispatchEvent(turbolinkLoadEvent); } else {