palantir/blueprint

DateRangeInput doesn't update displayed date when closeOnSelection=false (in control mode)

Open

#4484 aperta il 16 gen 2021

Vedi su GitHub
 (0 commenti) (1 reazione) (0 assegnatari)TypeScript (2167 fork)batch import
P2Package: datetimeType: bughelp wanted

Metriche repository

Star
 (20.263 star)
Metriche merge PR
 (Merge medio 43g 10h) (27 PR mergiate in 30 g)

Descrizione

Environment

  • Package version(s): @blueprintjs/datetime 3.20.0
  • Operating System: MacOS Mojave Version 10.14.6
  • Browser name and version: Firefox 84.0.2

Code Sandbox

Link to a minimal repro

Steps to reproduce

  1. Set the DateRangeInput to controlled mode (specify value and onChange props)
  2. Set closeOnSelection to false
  3. Change one of the dates

Actual behavior

The date is updated while hovering on different dates, but once the user clicks on a date, the displayed date becomes the old one (not the one the user clicked on). Once the user closes the DateRangeInput, the displayed date is updated to the correct one

Expected behavior

The date displayed after clicking on a date is the one that was clicked

Possible solution

For now I'm setting closeOnSelection=true. Not ideal, but less confusing than the current behavior

Guida contributor