Skip to content

Commit ddd12ed

Browse files
committed
clear the searchbox after quick-search
1 parent 8f20fcf commit ddd12ed

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

‎src/components/structures/RoomSubList.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,11 @@ var RoomSubList = React.createClass({
164164
}
165165
},
166166

167-
onRoomTileClick(roomId) {
167+
onRoomTileClick(roomId, ev) {
168168
dis.dispatch({
169169
action: 'view_room',
170170
room_id: roomId,
171+
clear_search: (ev && (ev.keyCode == 13 || ev.keyCode == 32)),
171172
});
172173
},
173174

‎src/components/structures/SearchBox.js‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,14 @@ module.exports = React.createClass({
4848
},
4949

5050
onAction: function(payload) {
51-
// Disabling this as I find it really really annoying, and was used to the
52-
// previous behaviour - see https://github.com/vector-im/riot-web/issues/3348
53-
/*
5451
switch (payload.action) {
5552
// Clear up the text field when a room is selected.
5653
case 'view_room':
57-
if (this.refs.search) {
54+
if (payload.clear_search && this.refs.search) {
5855
this._clearSearch();
5956
}
6057
break;
6158
}
62-
*/
6359
},
6460

6561
onChange: function() {

0 commit comments

Comments
 (0)