Skip to content
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

fix navigation with arrow keys #160

Merged
merged 2 commits into from
Oct 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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