mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
4.51k stars 1.31k forks source link

[pickers] `DateTimePicker` issue on pasting date ("ghost value": looks empty when unfocused, looks filled when focused) #15113

Open morzel85 opened 1 week ago

morzel85 commented 1 week ago

Steps to reproduce

Link to live example: https://mui.com/x/react-date-pickers/date-time-picker/#basic-usage

Steps:

  1. Pick some date/time value (e.g. 10/17/2024 12:00 AM).
  2. Paste some date to the filed (e.g. 10/19/2024).
  3. Leave the field.
  4. Get back to the field.

Current behavior

When date is pasted it is not changing the value shown in the field, when user moves out of the field, then the field is presented as empty (shows placeholder), when focus is restored the the date/time value is shown.

Expected behavior

Ideally pasting just a date should override the date part. Definitely field should not act as if it is empty while focus is lost and then present the value when focus is restored.

Context

No response

Your environment

npx @mui/envinfo ``` System: OS: Linux 5.15 Ubuntu 20.04.6 LTS (Focal Fossa) Binaries: Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm pnpm: 9.7.1 - ~/.local/share/pnpm/pnpm Browsers: Chrome: 130.0.6723.69 npmPackages: @emotion/react: 11.13.3 => 11.13.3 @emotion/styled: 11.13.0 => 11.13.0 @mui/icons-material: 6.1.4 => 6.1.4 @mui/material: 6.1.4 => 6.1.4 @mui/x-data-grid: 7.21.0 => 7.21.0 @mui/x-date-pickers: 7.21.0 => 7.21.0 @types/react: 18.3.3 => 18.3.3 react: 18.3.1 => 18.3.1 react-dom: 18.3.1 => 18.3.1 typescript: 5.5.4 => 5.5.4 ```

Search keywords: DateTimePicker value

michelengelen commented 1 week ago

Thanks for opening an issue here ... we will have a look at this. 👍🏼