UX: Select text in input when toggling search menu.

This commit is contained in:
Guo Xiang Tan 2016-07-08 14:17:02 +08:00
parent d1bb71f99d
commit e619af3eee
1 changed files with 4 additions and 1 deletions

View File

@ -215,7 +215,10 @@ export default createWidget('header', {
this.state.searchVisible = !this.state.searchVisible;
this.updateHighlight();
Ember.run.next(() => $('#search-term').focus());
if (this.state.searchVisible) {
Ember.run.schedule('afterRender', () => $('#search-term').focus().select());
}
},
toggleUserMenu() {