From 52a119244b2ff221c32c082166e77f9913833573 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 21 Apr 2017 01:21:25 +0100 Subject: [PATCH] Cancel quick-search on Escape, clearing it and returning focus to composer. Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/SearchBox.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/structures/SearchBox.js b/src/components/structures/SearchBox.js index d79617c0..d0868b69 100644 --- a/src/components/structures/SearchBox.js +++ b/src/components/structures/SearchBox.js @@ -100,6 +100,10 @@ module.exports = React.createClass({ } switch (ev.keyCode) { + case KeyCode.ESCAPE: + this._clearSearch(); + dis.dispatch({action: 'focus_composer'}); + break; case KeyCode.KEY_K: if (ctrlCmdOnly) { if (this.refs.search) {