From d962d6072e24e1c597fbc7c091a27b9113e10db1 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 12 Feb 2018 13:54:37 -0500 Subject: [PATCH] FIX: Don't auto select ALL topics, only keyboard chosen ones --- app/assets/javascripts/discourse/widgets/header.js.es6 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/discourse/widgets/header.js.es6 b/app/assets/javascripts/discourse/widgets/header.js.es6 index 12cd200c324..04fdd8902a6 100644 --- a/app/assets/javascripts/discourse/widgets/header.js.es6 +++ b/app/assets/javascripts/discourse/widgets/header.js.es6 @@ -230,11 +230,7 @@ export default createWidget('header', { if (state.searchVisible) { const contextType = this.searchContextType(); - if (!contextType) { - state.contextEnabled = undefined; - } - - if (state.searchContextType && state.searchContextType !== contextType) { + if (state.searchContextType !== contextType) { state.contextEnabled = undefined; state.searchContextType = contextType; } @@ -407,6 +403,10 @@ export default createWidget('header', { this.toggleHamburger(); break; case 'page-search': + let contextType = this.searchContextType(); + if (contextType === 'topic') { + this.state.searchContextType = contextType; + } if (!this.togglePageSearch()) { msg.event.preventDefault(); msg.event.stopPropagation();