From a94ff0845ba49971a06a8a00b12ed954cef83bdd Mon Sep 17 00:00:00 2001 From: schlagmichdoch Date: Tue, 12 Dec 2023 14:19:41 +0100 Subject: [PATCH] Blur base64 fallback textarea when hiding the dialog --- public/scripts/ui.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/public/scripts/ui.js b/public/scripts/ui.js index d64d886..9d2fe4c 100644 --- a/public/scripts/ui.js +++ b/public/scripts/ui.js @@ -729,7 +729,7 @@ class Dialog { hide() { this.$el.removeAttribute('show'); - if (!window.isMobile && this.$autoFocus) { + if (!window.isMobile) { document.activeElement.blur(); window.blur(); } @@ -2153,13 +2153,13 @@ class Base64Dialog extends Dialog { // ?base64text=hash#BASE64ENCODED // base64 encoded text is url hash which cannot be seen by the server and is faster (recommended) this.show(); - await this.processBase64Text(hash) + await this.processBase64Text(hash); } else { // ?base64text=BASE64ENCODED // base64 encoded text is part of the url param. Seen by server and slow (not recommended) this.show(); - await this.processBase64Text(base64Text) + await this.processBase64Text(base64Text); } } @@ -2174,7 +2174,7 @@ class Base64Dialog extends Dialog { else if (base64Zip === 'hash') { // ?base64zip=hash#BASE64ENCODED // base64 encoded zip file is url hash which cannot be seen by the server - await this.processBase64Zip(hash) + await this.processBase64Zip(hash); } } @@ -2269,6 +2269,8 @@ class Base64Dialog extends Dialog { hide() { this.$pasteBtn.removeEventListener('click', _ => this._clickCallback()); this.$fallbackTextarea.removeEventListener('input', _ => this._inputCallback()); + this.$fallbackTextarea.setAttribute('disabled', true); + this.$fallbackTextarea.blur(); super.hide(); } }