Skip to content

Commit

Permalink
fix navigation with arrow keys (#160)
Browse files Browse the repository at this point in the history
* fix navigation with arrow keys

* replace deprecated KeyboardEvent.keyCode
  • Loading branch information
samuelmeuli authored and dannyvankooten committed Oct 15, 2018
1 parent 2d4eb15 commit 43160ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions assets/src/js/components/DatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class DatePicker extends Component {
@bind
handleKeyPress(evt) {
// Don't handle input when the user is in a text field or text area.
let tag = event.target.tagName;
let tag = evt.target.tagName;
if(tag === "INPUT" || tag === "TEXTAREA") {
return;
}
Expand All @@ -178,7 +178,7 @@ class DatePicker extends Component {
let diff = this.state.endDate - this.state.startDate + 1000;
let newStartDate, newEndDate;

switch(evt.keyCode) {
switch(evt.which) {
// left-arrow
case 37:
newStartDate = new Date(+this.state.startDate - diff)
Expand Down
2 changes: 1 addition & 1 deletion assets/src/js/components/SiteSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class SiteSettings extends Component {
@bind
handleKeydownEvent(evt) {
// close modal when pressing ESC
if(evt.keyCode == 27) {
if(evt.which == 27) {
this.props.onClose()
}
}
Expand Down

0 comments on commit 43160ea

Please sign in to comment.