From f0d453187d1efffa52c25d971d4826f8250e32a8 Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Wed, 14 Aug 2024 11:16:02 -0600 Subject: [PATCH] Fix editable-text dir not affecting existing input --- chrome/content/zotero/elements/editableText.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/chrome/content/zotero/elements/editableText.js b/chrome/content/zotero/elements/editableText.js index fe0150f091..0fde6f6396 100644 --- a/chrome/content/zotero/elements/editableText.js +++ b/chrome/content/zotero/elements/editableText.js @@ -39,8 +39,6 @@ class EditableText extends XULElementBase { _input; - _textDirection = null; - _ignoredWindowInactiveBlur = false; _focusMousedownEvent = false; @@ -141,7 +139,6 @@ } set value(value) { - this.resetTextDirection(); this.setAttribute('value', value || ''); } @@ -188,8 +185,7 @@ return this._input; } - resetTextDirection() { - this._textDirection = null; + _resetTextDirection() { this._input?.removeAttribute('dir'); } @@ -201,7 +197,10 @@ this.style.maxWidth = `calc(${span.getBoundingClientRect().width}px + ${paddingLeft} + ${paddingRight} + ${borderLeftWidth} + ${borderRightWidth})`; }; - attributeChangedCallback() { + attributeChangedCallback(name) { + if (name === 'value' || name === 'dir') { + this._resetTextDirection(); + } this.render(); }