Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Sergey Vinogradov <[email protected]>
  • Loading branch information
web-padawan and vursen authored Oct 3, 2021
1 parent ffe70e1 commit d240667
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/field-base/src/field-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d240667

Please sign in to comment.