Skip to content

[Date Time Picker] Calls onChange(null) on ClickAway during edit #4358

@BGehrels

Description

@BGehrels

Affected Versions:

  • 5.0.0-alpha.68
  • Not affected: 5.0.0-alpha.67

How to reproduce:

The following description refers to MUIs component example page because it is the easiest way to describe the bad behaviour. The underlying issue is of course more or less independent of the example in the docs.

  • Go to https://mui.com/components/date-time-picker/#basic-usage
  • You'll see a "Basic usage" Headline and pre-filled DateTime Input field
  • Click the calender Icon in the Input field
  • Choose a different day of the same month
  • You will see that the Text in the input field adapts to the new date you just chose
  • Click some piece of background page whitespace far away from the Input field and the datepicker (ClickAway)

Expected Behaviour:

  • The date picker will close
  • The date field won't change

Actual Behaviour:

  • The date picker will close
  • The date field changes back to the initial value it had during page load

Why:

  • When you click away, The DateTimePicker component calls onChange(null). It did not do sol in versions <= 5.0.0-alpha.67

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