From d240667f31c127a3077022816225e1cd42b015af Mon Sep 17 00:00:00 2001 From: Serhii Kulykov Date: Sun, 3 Oct 2021 12:27:12 +0300 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Sergey Vinogradov --- packages/field-base/src/field-mixin.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/field-base/src/field-mixin.js b/packages/field-base/src/field-mixin.js index c049bf0703..6abbe96115 100644 --- a/packages/field-base/src/field-mixin.js +++ b/packages/field-base/src/field-mixin.js @@ -122,7 +122,7 @@ export const FieldMixin = (superclass) => const oldHelper = info.removedNodes.find((node) => node === helper); if (newHelper) { - // Custom helper is added, remove the default one. + // Custom helper is added, remove the previous one. if (helper && helper.isConnected) { this.removeChild(helper); } @@ -262,11 +262,10 @@ export const FieldMixin = (superclass) => let helper = this._helperNode; const hasHelper = this.__isNotEmpty(helperText); - if (hasHelper) { + if (hasHelperText && !helper) { // Create helper lazily - if (!helper) { - helper = this.__attachDefaultHelper(); - } + helper = this.__attachDefaultHelper(); + } } // Only set text content for default helper