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.
This commit is contained in:
parent
317d70d4ff
commit
8b5d92591d
1 changed files with 8 additions and 3 deletions
|
|
@ -80,9 +80,11 @@ class RenderScripture {
|
||||||
constructor(dialog) {
|
constructor(dialog) {
|
||||||
this.dialog = dialog;
|
this.dialog = dialog;
|
||||||
|
|
||||||
|
/*history.replaceState({dialog: false}, '');
|
||||||
window.addEventListener('popstate', (evt) => {
|
window.addEventListener('popstate', (evt) => {
|
||||||
|
console.log("popState", evt);
|
||||||
this.closeDialog();
|
this.closeDialog();
|
||||||
});
|
});*/
|
||||||
|
|
||||||
if (hasLocalStorage()) {
|
if (hasLocalStorage()) {
|
||||||
this.ls = true;
|
this.ls = true;
|
||||||
|
|
@ -126,11 +128,12 @@ class RenderScripture {
|
||||||
.classList.remove('hidden');
|
.classList.remove('hidden');
|
||||||
this.buildTranslationList(this.sel);
|
this.buildTranslationList(this.sel);
|
||||||
this.readScripture(refs);
|
this.readScripture(refs);
|
||||||
history.pushState({
|
console.log("pushState()");
|
||||||
|
/*history.pushState({
|
||||||
dialog: true,
|
dialog: true,
|
||||||
scripture: scripture.value,
|
scripture: scripture.value,
|
||||||
tx: this.translation
|
tx: this.translation
|
||||||
}, '');
|
}, '', '#dialog');*/
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTranslationList(sel) {
|
buildTranslationList(sel) {
|
||||||
|
|
@ -154,6 +157,8 @@ class RenderScripture {
|
||||||
this.dialog[0]?.close();
|
this.dialog[0]?.close();
|
||||||
this.dialog[0]?.classList.add('hidden');
|
this.dialog[0]?.classList.add('hidden');
|
||||||
this.dialog[0]?.querySelector('article')?.replaceChildren();
|
this.dialog[0]?.querySelector('article')?.replaceChildren();
|
||||||
|
history.replaceState({}, '', '');
|
||||||
|
//history.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
txnOnChange(evt) {
|
txnOnChange(evt) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue