I created a lightning component with lightning:recordEditForm and lightning:inputField to create a new record.

I have another field which I don't want it to be in the form but I want to populate it.

I didn't find a way to do this without put it in the form and use "slds-hidden" but that makes a gap in the UI.

Does someone know what to do in that case ? I mean, is there a better way to hide the field ? Or maybe a solution to "remove" the gap ?


  • 6
    Use slds-hide instead of slds-hidden. Sep 2, 2018 at 12:45
  • Thanks ! slds-hide worked !!! I didn't event know it exists.
    – osos9
    Sep 2, 2018 at 12:52
  • @itzmukeshy7, add your answer =P
    – glls
    Sep 2, 2018 at 13:53

1 Answer 1


Use slds-hide instead of slds-hidden.

So the thing is if you just want to disappear the element from the UI then use the slds-hidden and it will take its space.

And to remove the space as well use the slds-hide.

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.