react-datepicker icon indicating copy to clipboard operation
react-datepicker copied to clipboard

Error when pressing Arrow Down in input when preventOpenOnFocus is true

Open melgish opened this issue 3 years ago • 1 comments

Describe the bug When preventOpenOnFocus and open properties are both used, an exception will be raised if Arrow Down, Arrow Up, or Enter is pressed while input field has focus and open is false.

To Reproduce See Code Pen: https://codepen.io/melgish/pen/PoOzVzM for sample

  1. Add DatePicker to page with open=false and opreventOpenOnFocus=true
  2. Click on input
  3. Press any of the named keys
  4. Review error in console

Expected behavior No Error.

Desktop (please complete the following information):

  • OS: Windows
  • Browser Chrome
  • Version 97.0.4692.99

Additional context From the look of it, the internal state.open gets out of sync with the user's requested state. This may be related to or mitigated by https://github.com/Hacker0x01/react-datepicker/issues/2140 since the state falls out of sync during the click event

melgish avatar Feb 03 '22 18:02 melgish

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 13 '22 06:08 stale[bot]

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 10 days.

github-actions[bot] avatar Jun 20 '24 01:06 github-actions[bot]

This issue was closed because it has been stalled for 10 days with no activity.

github-actions[bot] avatar Jun 30 '24 01:06 github-actions[bot]