Error when pressing Arrow Down in input when preventOpenOnFocus is true
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
- Add DatePicker to page with open=false and opreventOpenOnFocus=true
- Click on input
- Press any of the named keys
- 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
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.
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.
This issue was closed because it has been stalled for 10 days with no activity.