0

How can I remove space between the lightning-layout-item and the lightning-input-field on the record-edit-form in salesforce LWC. I have removed label of the element but the space still existing here, Please find below screenshot in which i need the space in table need to be remove enter image description here

my code looks like this -

`<lightning-layout>
            <lightning-layout-item variant="label-stacked" class="lightninglayout slds-size_1-of-5">
                <div class="titleheadings">March</div>
            </lightning-layout-item>
            <lightning-layout-item variant="label-stacked" class="lightninglayout slds-size_1-of-5">
                <lightning-input-field field-name={EstimateMar}> </lightning-input-field>
            </lightning-layout-item>
            <lightning-layout-item variant="label-stacked" class="lightninglayout slds-size_1-of-5">
                <lightning-input-field field-name={NegotiatedMar}> </lightning-input-field>
            </lightning-layout-item>
            <lightning-layout-item variant="label-stacked" class="lightninglayout slds-size_1-of-5">
                <lightning-input-field field-name={PlanFieldMar}> </lightning-input-field>
            </lightning-layout-item>
            <lightning-layout-item variant="label-stacked" class="lightninglayout slds-size_1-of-5">
                <lightning-input-field field-name={ActualFieldMar}> </lightning-input-field>
            </lightning-layout-item>
        </lightning-layout>`

I really appricate any help on this. Thanks in advance

3
  • did you try to add variant="label-hidden" in your input field?
    – Rohit
    Commented Feb 28, 2023 at 11:54
  • check this answer, I assume this is the same issue salesforce.stackexchange.com/questions/395408/… Commented Feb 28, 2023 at 11:56
  • yes I tried this but not sure if its problem with LWC or something, nothing gets hidden if I use the variant="label-hidden" so I just loaded custom CSS for this from static resource to hide label
    – user128706
    Commented Feb 28, 2023 at 12:10

1 Answer 1

0

Use variant="label-hidden" instead. label-stacked places the label above the input, but label-hidden instead doesn't render the space for the label at all.

You must log in to answer this question.

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