mui/material-ui-pickers

Changing StaticTimePicker input field will change the date to current date

ruixuel opened this issue ยท 1 comments

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior ๐Ÿ˜ฏ

There are DatePicker and StaticTimePicker which uses same selectedDate value.
When changing the input box in StaticTimePicker, it will automatically change the date to current date.

Expected Behavior ๐Ÿค”

Changing the input box of StaticTimePicker should not change the date.

Steps to Reproduce ๐Ÿ•น

Sandbox link:
https://codesandbox.io/s/material-demo-forked-edquv?file=/demo.js

Steps:

  1. Click the pencil icon in the Static time picker to change to input box editor view
  2. Change the time in the input box of time picker
  3. The date in the Date picker changes to the current date

Context ๐Ÿ”ฆ

We implement a DateTimeRangePicker with DateRangePicker and two StaticTimePicker.
The user can set the start date/time and end date/time. With this bug, when the user sets the time in the input box it will change the date they already set.

Your Environment ๐ŸŒŽ

Tech Version
@material-ui/core v4.11.0
@material-ui/pickers v4.0.0-alpha.12
React 16.14.0
TypeScript 3.8.3

Same as 'inline' variant, changing year but no pick date will still trigger onChange event.