Skip to content

Commit

Permalink
fix: prevent default on tab-bar items.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Thulin committed Jan 8, 2024
1 parent 0a56d9f commit f9a7b86
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions assets/js/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ class FormNavigationManager {
/* Cancel button */
const cancelButton = document.getElementById("cancel-button");
if (cancelButton) {
cancelButton.addEventListener("click", function () {
cancelButton.addEventListener("click", function (e) {
e.preventDefault();
const userConfirmed = window.confirm("Är du säker på att du vill avbryta? All inmatad information förloras.");
if (userConfirmed == true) {
reloadPage(
Expand All @@ -108,7 +109,8 @@ class FormNavigationManager {
/* Close button */
const closeButton = document.getElementById("close-button");
if (closeButton) {
closeButton.addEventListener("click", function () {
closeButton.addEventListener("click", function (e) {
e.preventDefault();
reloadPage(
new URLSearchParams(window.location.search).get("closeUrl") ?? null
);
Expand Down

0 comments on commit f9a7b86

Please sign in to comment.