Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Commit

Permalink
Add esc to exit field #655
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunkat committed Apr 20, 2017
1 parent 349f9af commit 19918df
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/components/app/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ class Modal extends Component {
data={data}
layout={layout}
setFetchOnTrue={this.setFetchOnTrue}
removeModal={this.removeModal}
/>
)
}
Expand Down
11 changes: 7 additions & 4 deletions src/components/app/OverlayField.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ class OverlayField extends Component {
}

handleKeyDown = (e) => {
const {setFetchOnTrue} = this.props;
const {setFetchOnTrue, removeModal} = this.props;
switch(e.key) {
case 'Enter':
document.activeElement.blur();
setFetchOnTrue();
break;
document.activeElement.blur();
setFetchOnTrue();
break;
case 'Escape':
removeModal();
break;
}
}

Expand Down

0 comments on commit 19918df

Please sign in to comment.