Lech Migdal Lech Migdal - 10 months ago 60
React JSX Question

Components displayed vertically after adding DatePicker

After I've added DatePickers to a simple form, all components got placed vertically, while I would prefer them to be placed horizontally. Is there any parameter that should be set to make this work, or I must play a bit with CSS?

<TextField hintText="Enter text"/>
<DatePicker hintText="Date from" container="inline" mode="landscape" />
<DatePicker hintText="Date to" container="inline" mode="landscape" />
<img src="img/ic_search_black_24px.svg"/>

Any suggestions are appreciated!

Answer Source

On each DatePicker, set the style to:

style={{ display: 'inline-block' }}