Skip to content

Commit

Permalink
FIX: Do not query backend when searching "in this topic" (#14649)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmusaraj committed Oct 19, 2021
1 parent 25097fa commit a1daf9f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app/assets/javascripts/discourse/app/widgets/search-menu.js
Expand Up @@ -428,7 +428,6 @@ export default createWidget("search-menu", {

triggerSearch() {
searchData.noResults = false;

if (SearchHelper.includesTopics()) {
if (this.state.inTopicContext) {
this.searchService().set("highlightTerm", searchData.term);
Expand All @@ -438,7 +437,9 @@ export default createWidget("search-menu", {
SearchHelper.perform(this);
} else {
searchData.loading = false;
discourseDebounce(SearchHelper, SearchHelper.perform, this, 400);
if (!this.state.inTopicContext) {
discourseDebounce(SearchHelper, SearchHelper.perform, this, 400);
}
}
},

Expand Down
3 changes: 2 additions & 1 deletion app/assets/stylesheets/common/base/search-menu.scss
Expand Up @@ -36,8 +36,9 @@ $search-pad-horizontal: 0.5em;
}
}

.btn {
.btn.search-context {
margin: 2px;
margin-right: 0;
}
&:focus-within {
@include default-focus;
Expand Down

0 comments on commit a1daf9f

Please sign in to comment.