Skip to content

Commit

Permalink
potential mod for create form actions to helpers.js so that it is the…
Browse files Browse the repository at this point in the history
… same with and without Turbolinks on Left branch from failed form submission.
  • Loading branch information
Montmorency committed Aug 30, 2021
1 parent 041bd18 commit 14fdc68
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/IHP/static/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 14fdc68

Please sign in to comment.