When using a DateRangePicker and setting granularity dynamically from "day" to "second", the date input gets cleared when entering the first character of the time input. See repro steps below for video, detailed steps & minimal repro code.
๐ค Expected Behavior?
When entering the time, the date that the user just entered should not be cleared.
๐ฏ Current Behavior
When entering the time, the date that the user just entered is cleared. This only happens the first time.
๐ Possible Solution
Work-around: set a key based on the granularity to force React to create a new component instance with new internal state whenever granularity changes.
๐ฆ Context
No response
๐ฅ๏ธ Steps to Reproduce
See screen recording & minimal repro code below.
Steps to repro:
Change the granularity from "day" to "second". This is important. When making the granularity static/hard-coded, the bug doesn't happen.
Start typing the date.
When the first character of the time is entered, the date input is cleared again!
Provide a general summary of the issue here
When using a
DateRangePicker
and settinggranularity
dynamically from"day"
to"second"
, the date input gets cleared when entering the first character of the time input. See repro steps below for video, detailed steps & minimal repro code.๐ค Expected Behavior?
When entering the time, the date that the user just entered should not be cleared.
๐ฏ Current Behavior
When entering the time, the date that the user just entered is cleared. This only happens the first time.
๐ Possible Solution
Work-around: set a
key
based on thegranularity
to force React to create a new component instance with new internal state whenevergranularity
changes.๐ฆ Context
No response
๐ฅ๏ธ Steps to Reproduce
See screen recording & minimal repro code below.
Steps to repro:
granularity
from"day"
to"second"
. This is important. When making the granularity static/hard-coded, the bug doesn't happen.https://github.com/user-attachments/assets/295aff8e-6e57-4d07-b1c3-d48d260ede3c
Version
1.4.1
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
macOS / Ubuntu
๐งข Your Company/Team
No response
๐ท Tracking Issue
No response