mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-12-27 02:23:28 +08:00
* Fix issue #2758. Press Escape after a finished search to get back to Inbox Use a keydown event when search bar is in focus to capture escape key press * fix(search): Convert to ES2016
This commit is contained in:
parent
48db9ecd9f
commit
6377da8291
1 changed files with 7 additions and 0 deletions
|
@ -90,6 +90,12 @@ export default class SearchBar extends React.Component {
|
|||
}, 150);
|
||||
}
|
||||
|
||||
_onKeyDown = (event) => {
|
||||
if (event.keyCode === 27) {
|
||||
this._onClearAndBlur();
|
||||
}
|
||||
}
|
||||
|
||||
_doSearch = () => {
|
||||
SearchActions.querySubmitted(this.state.query);
|
||||
}
|
||||
|
@ -142,6 +148,7 @@ export default class SearchBar extends React.Component {
|
|||
onChange={this._onValueChange}
|
||||
onFocus={this._onFocus}
|
||||
onBlur={this._onBlur}
|
||||
onKeyDown={this._onKeyDown}
|
||||
/>,
|
||||
loupeImg,
|
||||
<RetinaImg
|
||||
|
|
Loading…
Reference in a new issue