when I use :
<aura:application extends="force:slds" >
<div>
<lightning:input type="text" label="myLabel" name="withLabel" value="withLabel" />
</div>
</aura:application>
The input element takes the whole width of the parent element (and that's excellent):
But when I use the label-hidden
option:
<aura:application extends="force:slds" >
<div>
<lightning:input type="text" variant="label-hidden" label="noLabel" name="noLabel" value="noLabel" />
</div>
</aura:application>
The input element takes only part of the parent element (and that is my problem):
I tried to play with css to fix that, but I couldn't find the right solution.
QUESTIONS
- Why is the component not taking 100% width when the label is hidden?
- Is there a better way to define the
lightning:input
component so this behavior will be fixed? - If not - I need a good css solution to this problem.
UPDATE - added css rules that did not work
.THIS .lightningInput {
display: flex;
}
slds-form_inline
styling. To maintain hidden labels without the label still taking up space on the page, see my answer here salesforce.stackexchange.com/a/221202/987