Material-ui: Datepicker's TextField width 100%

Created on 18 Nov 2015  路  5Comments  路  Source: mui-org/material-ui

Hello,
is there a possibility to set the datepicker's textfield at width: 100% or flex: 1 ?

question

Most helpful comment

This can be done like this:

<DatePicker hintText="Portrait Dialog" textFieldStyle={{width: '100%'}} />

Looks like this:
screen shot 2016-04-14 at 10 53 19 am

Closing this issue for now.

All 5 comments

+1

alternatvely, i can't figure out how to display a datepicker and a dropdown menu in the same row, without having vertical alignment issues (it almost seems as if the two elements belong to two different toolkits).

This can be done like this:

<DatePicker hintText="Portrait Dialog" textFieldStyle={{width: '100%'}} />

Looks like this:
screen shot 2016-04-14 at 10 53 19 am

Closing this issue for now.

In DatePicker, how to change the styling of underline under the textField?

@jatin46 I added a className to the DatePicker, then styled it in css using .datepicker hr with each property needing !important to take effect.

Just use inline style like this style={{ width: 250 }} it worked for me.

Was this page helpful?
0 / 5 - 0 ratings