0

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.

enter image description here

2
  • Did you check if there are any custom field labels added to your component? – Rahul Gawale Mar 18 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 Kumbhar Mar 18 at 14:20
1

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>
2
  • 1
    its working, just have to add few css to make it proper align to input control. Thanks a lot. – Harshad Kumbhar Mar 18 at 14:42
  • @HarshadKumbhar You may mark the answer as accepted if it is working for you. – Rahul Gawale Mar 18 at 15:38

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.