mui-x icon indicating copy to clipboard operation
mui-x copied to clipboard

[pickers] Missing emptyLabel feature on datepicker and timepicker

Open sergioavazquez opened this issue 2 years ago • 4 comments

In material-ui-pickers there's a feature that allows you to set a custom label when the value of the picker is null.

Prop name is emptyLabel and has the following description: Message displaying in text field, if null passed

You can read about it here: https://material-ui-pickers.dev/api/KeyboardDatePicker

  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

I also added a question on StackOverflow in case there's a workaround but haven't found any: https://stackoverflow.com/questions/69815113/how-to-set-an-empty-label-on-material-ui-v5-mui-lab-datepicker-component

Summary 💡

Provide an emptyLabel or similar prop to all date and time pickers so a string can be displayed when the value of the picker is null.

Examples 🌈

When the value of the date or time picker is null, instead of showing a blank input display the emptyLabel string instead.

Motivation 🔦

This feature is present in material-ui-pickers and I depend on it to provide useful information to the user when the picker has a null value. I'm migrating an app to MUI v5 and replacing material-ui-pickers with @mui/lab versions but this missing feature prevents me from moving on with it.

sergioavazquez avatar Nov 04 '21 13:11 sergioavazquez