fix(field): value delegation compatible with FormatMixin
This commit is contained in:
parent
b38c6c3978
commit
3217c1a739
1 changed files with 6 additions and 1 deletions
|
|
@ -102,11 +102,16 @@ export class LionField extends FormControlMixin(
|
||||||
}
|
}
|
||||||
|
|
||||||
connectedCallback() {
|
connectedCallback() {
|
||||||
|
// TODO: Normally we put super calls on top for predictability,
|
||||||
|
// here we temporarily need to do attribute delegation before,
|
||||||
|
// so the FormatMixin uses the right value. Should be solved
|
||||||
|
// when value delegation is part of the calculation loop of
|
||||||
|
// FormatMixin
|
||||||
|
this._delegateInitialValueAttr();
|
||||||
super.connectedCallback();
|
super.connectedCallback();
|
||||||
|
|
||||||
this._onChange = this._onChange.bind(this);
|
this._onChange = this._onChange.bind(this);
|
||||||
this.inputElement.addEventListener('change', this._onChange);
|
this.inputElement.addEventListener('change', this._onChange);
|
||||||
this._delegateInitialValueAttr();
|
|
||||||
this.classList.add('form-field'); // eslint-disable-line
|
this.classList.add('form-field'); // eslint-disable-line
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue