Skip to content

don't render labels when no label text is provided #347

Closed
@zoul0813

Description

@zoul0813

While working on custom checkbox components that include a label, I've discovered that all fields have a label tag rendered when "fieldTypeHasLabel" returns true. I propose adding an additional check to this function to return false when the field's schema does not have a label property (or altering the v-if statement on the label.

// option 1: add the following to fieldTypeHasLabel(field)
if(isNil(field.label)) 
  return false;
// option 2: alter the label v-if
label(v-if="field.label && fieldTypeHasLabel(field)", :for="getFieldID(field)", :class="field.labelClasses")

This requires the unit tests to be aware of this change as well.

I can submit a PR for this change if approved. Just need to know which option makes more sense.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions