[SalesForce] variant=’label-hidden’ Not Working for lightning-input-field When field is a Lookup

I have a Lightning Web Component and in that I'm using a lighting-record-edit-form. I'm trying to use a custom label for an input by hiding the default one for the lightning-input-field and adding my own. I'm using the variant='label-hidden' and it isn't working.

It works on other fields, just not when the field rendered is a lookup field or a Rich Text field.

I've tried some different things with CSS but it doesn't seem to be picking it up.

I've seen some other similar questions with work arounds but they appear to only be for Aura components.

Anybody else encountered this or come up with a workaround?

<lighting-input-field field-name='Lookup_Field__c' variant='label-hidden'></lightning-input-field>

Best Answer

I see its working now by using variant="label-hidden"

<lightning-input-field field-name="AccountId" variant="label-hidden"></lightning-input-field>

enter image description here

Related Topic