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

View file

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