Fix editable-text dir not affecting existing input
Some checks are pending
CI / Build, Upload, Test (push) Waiting to run
Some checks are pending
CI / Build, Upload, Test (push) Waiting to run
This commit is contained in:
parent
64238d56bc
commit
f0d453187d
1 changed files with 5 additions and 6 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue