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 (2,167 fork)batch import
P2Package: datetimeType: bughelp wanted

仓库指标

Star
 (20,263 star)
PR 合并指标
 (平均合并 43天 10小时) (30 天内合并 27 个 PR)

描述

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

贡献者指南