Adornment icon does not display properly with [email protected]
When upgrading to latest version of @material-ui/core (v3.1.1), the adornment icon of date and time picker does not display properly.
It is caused by the style alignItems: 'flex-end' set in DateTextField. With the value center, it's better.
Environment
| Tech | Version |
|---|---|
| material-ui-pickers | 1.0.0-rc.14 |
| material-ui | 3.1.1 |
| React | 16.4.0 |
| Browser | any |
| Peer library | date-fns |
Live example
https://codesandbox.io/s/8n5nlorkv8
I am facing the same issue. Right now remove the icon for calendar temporarily.
Same issue here.
It seems that removing the 0.01em height in MuiInputAdornment-root also fixes the problem, but @alex-fournier solution is probably cleaner.
Workaround:
define your classes:
const styles = {
root : {
height: 32
}
}
customize your component with them:
withStyles(styles)(RangePicker)
pass the adornment overriding the root class through the InputAdornmentProps:
<DatePicker
keyboard
label={<FormattedMessage id="DataSelector.endDate" />}
format='DD/MM/YYYY'
mask={value => (value ? [/\d/, /\d/, '/', /\d/, /\d/, '/', /\d/, /\d/, /\d/, /\d/] : [])}
value={rangeTo}
style={{ width: '150px' }}
disabled={disabled}
onChange={this.onChangeEnd}
disableOpenOnEnter
animateYearScrolling={false}
InputAdornmentProps={{ classes: { root: classes.root } }}
/>
Fixed in rc.15