Material-ui-pickers: InlineDatePicker doesn't display the clear button when clearable prop is set to true

Created on 12 Sep 2018  路  6Comments  路  Source: mui-org/material-ui-pickers

Environment

| Tech | Version |
|---------------------|---------|
| material-ui-pickers | 1.0.0-rc.14 |
| material-ui | 1.4.2 |
| React | 16.4.2 |
| Browser | Chrome 68 |
| Peer library | moment 2.22.2 |

Steps to reproduce

  1. Use an <InlineDatePicker> component
  2. set the clearable prop to true
  3. open the date picker in the browser

Expected behavior

The "Clear" button should be displayed to allow clearing the input

Actual behavior

The "Clear" button is not visible

Most helpful comment

This was a solution I came up with for this. Hope this helps anyone who stumbles across this. If there is a better way let me know.

I am using Formik on my app so I included it in the example.
https://codesandbox.io/s/42y21jj057

All 6 comments

Inline date picker is not supporting this functionality

Well, is there any way to clear value when using InlineDatePicker?

You can do it manually. Add input adornment with button to clear the value

This was a solution I came up with for this. Hope this helps anyone who stumbles across this. If there is a better way let me know.

I am using Formik on my app so I included it in the example.
https://codesandbox.io/s/42y21jj057

Unfortunately last solution not worked with keyboard prop like

Workaround:
1) add onClick={openPicker} for IconButton Calendar
2) realize openPicker like https://material-ui-pickers.dev/guides/controlling-programmatically

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nicky-dev picture nicky-dev  路  3Comments

katy6514 picture katy6514  路  3Comments

harvitronix picture harvitronix  路  3Comments

charlax picture charlax  路  3Comments

danmce picture danmce  路  3Comments