diff --git a/app/assets/javascripts/discourse/components/search-menu.js.es6 b/app/assets/javascripts/discourse/components/search-menu.js.es6 index 153929ecd6b..41352528076 100644 --- a/app/assets/javascripts/discourse/components/search-menu.js.es6 +++ b/app/assets/javascripts/discourse/components/search-menu.js.es6 @@ -134,7 +134,7 @@ export default Ember.Component.extend({ }, showedSearch() { - $('#search-term').focus(); + $('#search-term').focus().select(); }, showSearchHelp() { diff --git a/app/assets/javascripts/discourse/components/search-text-field.js.es6 b/app/assets/javascripts/discourse/components/search-text-field.js.es6 index bf46ddf33f3..bb83304bcb2 100644 --- a/app/assets/javascripts/discourse/components/search-text-field.js.es6 +++ b/app/assets/javascripts/discourse/components/search-text-field.js.es6 @@ -5,5 +5,9 @@ export default TextField.extend({ @computed('searchService.searchContextEnabled') placeholder: function(searchContextEnabled) { return searchContextEnabled ? "" : I18n.t('search.title'); + }, + + focusIn: function() { + Em.run.later(() => { this.$().select(); }); } }); diff --git a/app/assets/javascripts/discourse/templates/full-page-search.hbs b/app/assets/javascripts/discourse/templates/full-page-search.hbs index 43e3e835ad5..3b9bebb9620 100644 --- a/app/assets/javascripts/discourse/templates/full-page-search.hbs +++ b/app/assets/javascripts/discourse/templates/full-page-search.hbs @@ -1,5 +1,5 @@