From 3217c1a739d210f04422a60a1f5fbab9465c2c4f Mon Sep 17 00:00:00 2001 From: Joren Broekema Date: Wed, 14 Aug 2019 13:46:53 +0200 Subject: [PATCH] fix(field): value delegation compatible with FormatMixin --- packages/field/src/LionField.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/field/src/LionField.js b/packages/field/src/LionField.js index f423d0eba..f9abd5f2d 100644 --- a/packages/field/src/LionField.js +++ b/packages/field/src/LionField.js @@ -102,11 +102,16 @@ export class LionField extends FormControlMixin( } 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(); this._onChange = this._onChange.bind(this); this.inputElement.addEventListener('change', this._onChange); - this._delegateInitialValueAttr(); this.classList.add('form-field'); // eslint-disable-line }