We are using lightning record edit form in which there is lightning-input-field. this field is type of datetime. Please see screenshot attached. Start Date/Time and End Date/Time legend displaying in Bold and others are in normal font-weight. we want to remove it and tried many CSS but could not able to fix it Can anyone please help in fixing this issue.
-
Did you check if there are any custom field labels added to your component?– Rahul GawaleMar 18, 2021 at 14:18
-
@rahulgawale, no it is just regular lightning-input-field elements under record-edit form. Not sure why only start date and end date is getting bold labels.– Harshad KumbharMar 18, 2021 at 14:20
1 Answer
Here is what you can do.
Change the variant
of the lightning-input-field
to the label-hidden
so it hides the standard label, now you can put the custom label using the below code.
<span class="slds-form-element_stacked">
<label class="slds-form-element__label" for="unique-id-of-input">Put your label here</label>
<lightning-input-field variant="label-hidden"....>
</lightning-input-field
</span>
-
1its working, just have to add few css to make it proper align to input control. Thanks a lot. Mar 18, 2021 at 14:42
-
@HarshadKumbhar You may mark the answer as accepted if it is working for you. Mar 18, 2021 at 15:38