2

Seems like attribute doesn't work anymore.

I know before label-hidden variant, I used to be able to hide labels using some CSS. Unsure what it was anymore.

2
  • 1
    Aura or LWC? Just checking.
    – sfdcfox
    May 8, 2019 at 12:58
  • 1
    have you reported this to Salesforce? have you checked list of known issues for available workaround?
    – Patlatus
    May 8, 2019 at 13:17

2 Answers 2

1

I solved the issue with adding this css:

.THIS .slds-form-element__label {
    display: none !important;
}

Maybe it can help you!

1
  • Sorry but that will hide all labels on screen, not a specific one.
    – dzh
    May 10, 2019 at 0:26
0

Wrote couple of these selectors that if anyone knows how to simplify - definetely let me know. Seems super fragile and ugly at least (dunno why comma separation didn't work here; ultimately I'd like to select any label in the hierarchy, not just immediate child).

Here's the CSS:

.THIS .inputField-label-hidden > * > label {
    display: none !important;
}
.THIS .inputField-label-hidden > * > * > label {
    display: none !important;
}
.THIS .inputField-label-hidden > * > * > * > label {
    display: none !important;
}
.THIS .inputField-label-hidden > * > * > * > * > label {
    display: none !important;
}

Use:

                <lightning:inputField
                        class="inputField-label-hidden"
                        fieldName="Something__c"/>
1
  • These worked with picklist, datetime, time fields. Haven't tested with others.
    – dzh
    May 10, 2019 at 2:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .