diff --git a/app/assets/javascripts/discourse/widgets/header.js.es6 b/app/assets/javascripts/discourse/widgets/header.js.es6 index 711aef6dc..b4974104b 100644 --- a/app/assets/javascripts/discourse/widgets/header.js.es6 +++ b/app/assets/javascripts/discourse/widgets/header.js.es6 @@ -229,11 +229,6 @@ export default createWidget('header', { togglePageSearch() { const { state } = this; - if (state.searchVisible) { - this.toggleSearchMenu(); - return false; - } - state.contextEnabled = false; const currentPath = this.container.lookup('controller:application').get('currentPath'); @@ -248,6 +243,11 @@ export default createWidget('header', { this.container.lookup('controller:topic').get('model.postStream.stream.length')); } + if (state.searchVisible) { + this.toggleSearchMenu(); + return showSearch; + } + if (showSearch) { state.contextEnabled = true; this.toggleSearchMenu();