Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 23f24a9

Browse files
authored
Merge pull request #2367 from matrix-org/bwindels/selectqueryonclick
Redesign: select search query on focus
2 parents 5e2ee88 + dd6dd7a commit 23f24a9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/structures/SearchBox.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ module.exports = React.createClass({
5656
case 'focus_room_filter':
5757
if (this.refs.search) {
5858
this.refs.search.focus();
59-
this.refs.search.select();
6059
}
6160
break;
6261
}
@@ -83,6 +82,10 @@ module.exports = React.createClass({
8382
}
8483
},
8584

85+
_onFocus: function(ev) {
86+
ev.target.select();
87+
},
88+
8689
_clearSearch: function(source) {
8790
this.refs.search.value = "";
8891
this.onChange();
@@ -108,6 +111,7 @@ module.exports = React.createClass({
108111
ref="search"
109112
className="mx_textinput_icon mx_textinput_search"
110113
value={ this.state.searchTerm }
114+
onFocus={ this._onFocus }
111115
onChange={ this.onChange }
112116
onKeyDown={ this._onKeyDown }
113117
placeholder={ _t('Filter room names') }

0 commit comments

Comments
 (0)