-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
Describe the bug
When using react-datepicker, the Escape key must be pressed twice to close the calendar. The first press removes focus from the input and passes it to the calendar. Only after a second Escape press does the calendar close.
To Reproduce
Steps to reproduce the behavior:
- Go to a page with react-datepicker rendered.
- Click on the input field to open the calendar.
- Press Escape.
- Observe that the calendar remains open.
- Press Escape again.
- Calendar finally closes.
Expected behavior
The calendar should close on the first Escape key press.
Screenshots
N/A
Desktop (please complete the following information):
- OS: MacOS 15.3.2
- Browser: Chrome
- Version: 133.0.6943.54
Smartphone (please complete the following information):
N/A
Additional context
I tried managing the open state manually and even intercepting the keydown event on the input field with no success. Codesandbox
Metadata
Metadata
Assignees
Labels
No labels