From 4fe4e10abb55d4735ecb3159731c77ea4f829981 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Wed, 12 Jul 2017 13:49:57 +0100 Subject: [PATCH] Implement the focus_room_filter action This is for ctrl+k room filtering and switching --- src/components/structures/SearchBox.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/structures/SearchBox.js b/src/components/structures/SearchBox.js index 99c44866..6e47f7a5 100644 --- a/src/components/structures/SearchBox.js +++ b/src/components/structures/SearchBox.js @@ -46,18 +46,22 @@ module.exports = React.createClass({ }, onAction: function(payload) { - // Disabling this as I find it really really annoying, and was used to the - // previous behaviour - see https://github.com/vector-im/riot-web/issues/3348 -/* switch (payload.action) { +/* Disabling this as I find it really really annoying, and was used to the + previous behaviour - see https://github.com/vector-im/riot-web/issues/3348 // Clear up the text field when a room is selected. case 'view_room': if (this.refs.search) { this._clearSearch(); } break; +*/ + case 'focus_room_filter': + if (this.refs.search) { + this.refs.search.focus(); + } + break; } -*/ }, onChange: function() {