-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ffe-datepicker-react): Press Enter to close calendar
This commit makes a simple improvement to keyboard navigation of the datepicker by allowing the calendar to be closed by pressing Enter while the date input field has focus. This solution is slightly different from the suggested solution. While the suggestions solution said the calendar would only close if the date is valid, this solution closes the calendar regardless and triggers validation. This allows us to show an error message to the user, rather than keeping them stuck in the calendar. This commit also removes the `onKeyPress` listener from Input. The reason for doing so is that the dual key listeners conflicted with the initial changes of this commit. I did extensive testing to assure this is a safe change to make. I am also reassured by the fact that we don't use this listener anywhere else in our code, while we use the `onKeyDown` listener extensively. This fixes #14
- Loading branch information
Henrik Hermansen
committed
Feb 28, 2018
1 parent
f0db120
commit d79d818
Showing
4 changed files
with
48 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters