Esri / calcite-design-system

A monorepo containing the packages for Esri's Calcite Design System
https://developers.arcgis.com/calcite-design-system/
Other
287 stars 76 forks source link

CalciteInputDatePicker with range sets end date when changing the start date if there's an initial value set #10113

Open fnquinteros opened 2 months ago

fnquinteros commented 2 months ago

Check existing issues

Actual Behavior

This only happens when there's an initial value set and only on the first input.

When it has an initial value set, setting the start date changes the end date and leaves the start date as it is. If you refresh and start over, changing the end date first set the start date to null.

After the first value change, the input behaves es axpected.

Expected Behavior

Setting the start or end date for the first time when there's an initial value changes them accordingly and do not change anything else.

Reproduction Sample

https://codesandbox.io/p/devbox/happy-hooks-742ty6?file=%2Fsrc%2FApp.jsx

Reproduction Steps

  1. Change the start date to some day a few days in the future (3 or 4 days)
  2. Observe the actual value set to the start date and check that the value you set was actually set on the end date.
  3. refresh
  4. set the end date
  5. observe the start date. It will be empty.

Reproduction Version

latest (2.11.1)

Relevant Info

Tested on Chrome latest version, on a Macbook. Also ran on code sandbox, so it should happen regardless of OS.

Regression?

No response

Priority impact

impact - p1 - need for current milestone

Impact

At the moment, this can be solved with a workaround by setting the initial value after rendering the component, instead of passing the initial value to the component right away.

We're planning on releasing a redesign of a feature that includes this date picker in October. Would be nice to have it fixed by then.

Calcite package

Esri team

ArcGIS Urban

github-actions[bot] commented 2 days ago

Installed and assigned for verification.