0

I have a problem with lightning:inputField, in my page I have a mix of lighting:input and lightning:inputField. When I dispaly inputField in large screen, the label is horizontally aligned with the input.

enter image description here

I would like to align it vertically.

There is my code

<aura:component >
    <aura:attribute name="account" type="Account" />
    <lightning:recordEditForm aura:id="formAccount" 
                              objectApiName="Account">
                <lightning:inputField fieldName="Name" value="{!v.account.Name}" />
                <lightning:input type="text"
                                 required="true"
                                 label="Account site"
                                 value="{!v.account.Site}" />
    </lightning:recordEditForm>
</aura:component>

Thank you.

0

i think your org moved to summer 19, please have look new changes in summer 19 , your use case you need to give density attribute for lightning:recordeditform please try below code

<aura:component >
<aura:attribute name="account" type="Account" />
<lightning:recordEditForm aura:id="formAccount" density="comfy" 
                          objectApiName="Account">
            <lightning:inputField fieldName="Name" value="{!v.account.Name}" />
            <lightning:input type="text"
                             required="true"
                             label="Account site"
                             value="{!v.account.Site}" />
</lightning:recordEditForm>

  • You're right, it works – dz00dz May 21 '19 at 14:22
0

I tried your code in my personal org and its working completely fine. When I dispalyed inputField in large screen, the label is aligned vertically with the label.

Try Element inspection by clicking F12, this would help you in finding what is going wrong.

  • When I use a large screen, this css class slds-form-element_stacked is replaced by slds-form-element_horizontal. When I see the response of @sdandamud1 I think your org didn't moved to Summer'19 – dz00dz May 21 '19 at 14:28

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.