Skip to content

🐛 Add missing datepicker close call onPopperKeyDown event - to handle ESC keydown event outside the day component #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 25, 2025

Conversation

balajis-qb
Copy link
Collaborator

Description

Linked issue: Hacker0x01#5520

Problem
As mentioned in the linked issue, the datepicker needs 2 esc key press to close. This is not happening always. If the control is there in any days, then one ESC key itself is closing the date picker. But if it's there in the DatePicker header (For E.g., Previous or Next month navigation button), then the first ESC key will just move the focus back to the DatePicker Input and then second Esc key only will close the DatePicker.

To Reproduce
Steps to reproduce the behavior:

  1. Go to a page with react-datepicker rendered.
  2. Click on the input field to open the calendar and click back and next navigate button for more than one times.
  3. Press Escape.
  4. Observe that the calendar remains open (It just moves the focus to the input).
  5. Press Escape again.
  6. Calendar finally closes.

Changes

  • Added the missing handleClose call to the onPopperKeyDown event handler
    image

Contribution checklist

  • I have followed the contributing guidelines.
  • I have added sufficient test coverage for my changes.
  • I have formatted my code with Prettier and checked for linting issues with ESLint for code readability.

@balajis-qb balajis-qb merged commit fb58b2a into main May 25, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant