palantir/blueprint

Dateinput and Dateinput2 popover and maxDate behavior

Open

#5771 opened on Nov 28, 2022

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

Description

Environment

  • Package version(s): Datetime 4.4.7 and Datetime2 0.9.5
  • Operating System: Windows 11
  • Browser name and version: Chrome 107 and Firefox 107

Code Sandbox

https://codesandbox.io/s/bold-david-nbr76c?file=/src/DatetimeExample.tsx

Steps to reproduce

Popover

  1. Click on Dateinput or Dateinput2 to show popover
  2. Change the hour field of the time picker to something like 10
  3. Click outside the popover to close it.
  4. Click on the Dateinput or Dateinput2 to show popover
  5. Change the hour field of the time picker to something like 11
  6. Click outside the popover to close it.

maxdate

  1. Click on Dateinput or Dateinput2 to show popover
  2. Change the hour field of the time picker to something like 10

Actual behavior

Popover With step 6 the popover will close and reopen straight away

maxdate For Dateinput it will accept the picked time but Dateinput will show a red border indicating the selected time is invalid

Expected behavior

Popover With step 6 the popover should close and not reopen

maxdate The maxdate should allow any hour of the maxday for Dateinput2 component

Possible solution

Contributor guide