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.

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

I solved the issue with adding this css:

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

Maybe it can help you!

  • Sorry but that will hide all labels on screen, not a specific one. – dzh May 10 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"/>
  • These worked with picklist, datetime, time fields. Haven't tested with others. – dzh May 10 at 2:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.