material-ui-pickers icon indicating copy to clipboard operation
material-ui-pickers copied to clipboard

Adornment icon does not display properly with [email protected]

Open alex-fournier opened this issue 8 years ago • 3 comments

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

alex-fournier avatar Sep 27 '18 15:09 alex-fournier

I am facing the same issue. Right now remove the icon for calendar temporarily.

chaoriwei avatar Sep 28 '18 00:09 chaoriwei

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 } }}
  />

leolozes avatar Sep 28 '18 08:09 leolozes

Fixed in rc.15

dmtrKovalenko avatar Sep 28 '18 19:09 dmtrKovalenko