palantir/blueprint

DateRangePicker shortcut still marked as active after manually updating the range

Open

#5,223 opened on Apr 4, 2022

View on GitHub
 (0 comments) (1 reaction) (0 assignees)TypeScript (20,263 stars) (2,167 forks)batch import
P2Package: datetimeType: bughelp wanted

Description

Environment

  • Package version(s): "@blueprintjs/core": "^3.40.1", "@blueprintjs/datetime": "^3.22.0",
  • Browser name and version: Chrome

Code Sandbox

Link to a minimal repro (fork this code sandbox):

Steps to reproduce

  1. Create Date Range Picker similar to https://blueprintjs.com/docs/#datetime/daterangepicker image
  2. Select "Past 6 months" and notice shortcut selected image
  3. Change date range manually to a different range image

Actual behavior

"Past 6 months" shortcut still selected

Expected behavior

No shortcut marked as selected

Possible solution

Reset shortcut selection on date range changed in case it's updated.

Contributor guide