palantir/blueprint

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

Open

#4,484 建立於 2021年1月16日

在 GitHub 查看
 (0 留言) (1 反應) (0 負責人)TypeScript (20,263 star) (2,167 fork)batch import
P2Package: datetimeType: bughelp wanted

描述

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

貢獻者指南