Skip to content

[DesktopDatePicker] previous value appears without picking a date. #4469

@kim-sanghoon

Description

@kim-sanghoon

Duplicates

  • I have searched the existing issues

I'm unsure but this could be related to #4358

Latest version

  • I have tested the latest version

Current behavior 😯

Previously selected value appears again. It seems the previous value persists internally.

Expected behavior 🤔

The input field should remain empty.

Steps to reproduce 🕹

Please use the following example: https://codesandbox.io/s/datepicker-value-persists-crx1cb

Steps:

  1. Press the calendar icon of DatePicker.
  2. Select an arbitrary date from the calendar.
  3. Press "CLICK TO RESET" button to reset value.
  4. Press the calendar icon of DatePicker.
  5. Press the calendar icon again to close the calendar.

Context 🔦

It looks the bug appeared from the version 5.0.0-alpha.68 of @mui/lab. I couldn't reproduce it with an older version.

Your environment 🌎

`npx @mui/envinfo`
  System:
    OS: macOS 11.5.2
  Binaries:
    Node: 14.17.5 - /usr/local/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 8.1.1 - /usr/local/bin/npm
  Browsers:
    Chrome: 99.0.4844.51
    Edge: Not Found
    Firefox: Not Found
    Safari: 15.0
  npmPackages:
    @emotion/react: ^11.7.1 => 11.8.2 
    @emotion/styled: ^11.6.0 => 11.8.1 
    @mui/base:  5.0.0-alpha.71 
    @mui/icons-material: ^5.2.5 => 5.5.0 
    @mui/lab: ^5.0.0-alpha.67 => 5.0.0-alpha.72 
    @mui/material: ^5.2.8 => 5.5.0 
    @mui/private-theming:  5.4.4 
    @mui/styled-engine:  5.4.4 
    @mui/styles: ^5.2.3 => 5.5.0 
    @mui/system:  5.5.0 
    @mui/types:  7.1.2 
    @mui/utils:  5.4.4 
    @types/react: ^17.0.2 => 17.0.40 
    react: ^17.0.2 => 17.0.2 
    react-dom: ^17.0.2 => 17.0.2 
    typescript: ^4.5.4 => 4.6.2 

Web browser information

Google Chrome 98.0.4758.102 (Official Build) (arm64)
Revision 273bf7ac8c909cde36982d27f66f3c70846a3718-refs/branch-heads/4758@{#1151}
OS macOS Version 11.5.2 (Build 20G95)
JavaScript V8 9.8.177.11
User Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36

Metadata

Metadata

Labels

scope: pickersChanges related to the date/time pickers.type: bugIt doesn't behave as expected.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions