I have a lightning:layout with a lightning:layoutItem, containing a lightning:select.
I want the row in the layout to be only the height of the select box but I can't figure out how to remove the space above it.
Here is my component:
<div class="slds-is-relative">
<lightning:layout verticalAlign="start">
<lightning:layoutItem padding="horizontal-small" size="1">
<lightning:select
aura:id="select"
name="regionFilter"
value="{!v.filterSelectedValueRegion}"
onchange="{!c.applyRegionFilter}"
class="slds-m-bottom_medium"
>
<option value="Default">-- Region --</option>
<option value="All">All</option>
<aura:iteration var="filterRegionOption" items="{!v.filterOptionsRegion}">
<option
value="{!filterRegionOption}"
text="{!filterRegionOption}"
selected="{!filterRegionOption.selected}"
/>
</aura:iteration>
</lightning:select>
</lightning:layoutItem>
</lightning:layout>
This is how it renders:
I want to reduce the vertical space between 'Home' and region selector.
This is what the inspector shows:
How do I get rid of that space above and below the region select box?
Best Answer
Further to comment from @sfdcfox above I tested some variations. This is the component:
and this is the result:
Interestingly, the
variant="label-inline"
on 'select2' seems to have no effect, but the lightning:select docs state 'Use label-inline to horizontally align the label and input field.'