primereact icon indicating copy to clipboard operation
primereact copied to clipboard

Calendar: "range" selectionMode: inconsistent/unintuitive behavior between keyboard/mouse for selecting single dates

Open jonashw opened this issue 2 years ago • 2 comments

Describe the bug

With "range" selectionMode, it is possible to

  • select a single date with the mouse
  • select a range of dates with the mouse
  • enter a range of dates with the keyboard

but it is not possible to enter a single date with the keyboard.

Reproducer

https://codesandbox.io/p/sandbox/primereact-calendar-range-keyboard-input-bug-hprff8

PrimeReact version

10.2.1

React version

18.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

Chrome 120

Steps to reproduce the behavior

  1. Go to https://codesandbox.io/p/sandbox/primereact-calendar-range-keyboard-input-bug-hprff8
  2. Click the form control to invoke the Calendar and click the first day of the present month. Notice this input is accepted
  3. Click the last day of the present month. Notice this input is accepted.
  4. Clear the control by clicking into it and pressing backspace on your keyboard.
  5. Enter '1/1/2024' on your keyboard, Notice that this input is not yet accepted.
  6. Continue by typing ' - 1/2/2024'. Notice that the combined input is accepted (the popover visually indicates the range you typed).

Expected behavior

I would expect that after entering a single date (step 5), that date would be accepted as valid input and the appropriate change listeners would fire, allowing my application to use the single date specified by keyboard.

jonashw avatar Jan 30 '24 22:01 jonashw

This issue has been automatically marked as stale. If this issue is still affecting you with the latest version, please leave any comment, and we will keep it open. We are sorry that we have not been able to prioritize it yet. If you have any new additional information, please include it with your comment!

github-actions[bot] avatar Jan 26 '25 01:01 github-actions[bot]

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you for your understanding!

github-actions[bot] avatar Feb 02 '25 01:02 github-actions[bot]