From 8b5d92591d1dfcdefbbc1bd1320d637150608697 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Shelton" Date: Thu, 20 Aug 2026 08:32:10 -0600 Subject: [PATCH] History implementation appears to cause issues in Chrome. It would seem that Chrome's history state with dialog.showModal causes issues requiring hitting "back" twice, even if history.pushState isn't ever used. --- src/utils/modal.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/utils/modal.js b/src/utils/modal.js index 435153a..0f24fdb 100644 --- a/src/utils/modal.js +++ b/src/utils/modal.js @@ -80,9 +80,11 @@ class RenderScripture { constructor(dialog) { this.dialog = dialog; + /*history.replaceState({dialog: false}, ''); window.addEventListener('popstate', (evt) => { + console.log("popState", evt); this.closeDialog(); - }); + });*/ if (hasLocalStorage()) { this.ls = true; @@ -126,11 +128,12 @@ class RenderScripture { .classList.remove('hidden'); this.buildTranslationList(this.sel); this.readScripture(refs); - history.pushState({ + console.log("pushState()"); + /*history.pushState({ dialog: true, scripture: scripture.value, tx: this.translation - }, ''); + }, '', '#dialog');*/ } buildTranslationList(sel) { @@ -154,6 +157,8 @@ class RenderScripture { this.dialog[0]?.close(); this.dialog[0]?.classList.add('hidden'); this.dialog[0]?.querySelector('article')?.replaceChildren(); + history.replaceState({}, '', ''); + //history.back(); } txnOnChange(evt) {