palantir/blueprint
在 GitHub 查看DateRangeInput doesn't update displayed date when closeOnSelection=false (in control mode)
Open
#4,484 建立於 2021年1月16日
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
Steps to reproduce
- Set the DateRangeInput to controlled mode (specify
valueandonChangeprops) - Set
closeOnSelectiontofalse - 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