Reputation: 485
I'm trying to put two select boxes next to each other using the Grid component. No matter if I change the direction of the container they are always stacked on top of each other. I want them side by side.
Here is a screenshot of the page :
Here is the code:
<Grid container>
<Grid item container direction="row">
<Grid item xs={12} sm={6}>
<Select
key={"msSeasons"}
placeholder={"Seasons.."}
options={multiSelectArrays.seasons}
isMulti={true}
isSearchable={false}
onChange={e => onSelectChange(e, "seasons")}
/>
<Select
key={"msOuts"}
placeholder={"Outs.."}
options={multiSelectArrays.outs}
isMulti={true}
isSearchable={false}
onChange={e => onSelectChange(e, "outs")}
/>
</Grid>
</Grid>
</Grid>
Upvotes: 1
Views: 10042
Reputation: 4719
You could make a separate grid item for each select element to keep it in a single row :
<Grid container>
<Grid item container direction="row">
<Grid item xs={12} sm={6}>
<Select
key={"msSeasons"}
placeholder={"Seasons.."}
options={multiSelectArrays.seasons}
isMulti={true}
isSearchable={false}
onChange={e => onSelectChange(e, "seasons")}
/>
</Grid>
<Grid item xs={12} sm={6}>
<Select
key={"msOuts"}
placeholder={"Outs.."}
options={multiSelectArrays.outs}
isMulti={true}
isSearchable={false}
onChange={e => onSelectChange(e, "outs")}
/>
</Grid>
</Grid>
</Grid>
Upvotes: 4