Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix search returning no results after explicitly selecting "All categories" #1872

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions assets/javascript/guides-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,18 @@ const app = createApp({
},
category: {
get() {
// Turn null to "", because that's how the select box refers to "all categories"
// Turn "no entry" into "", because that's how the select box refers to "all categories"
return this.search.input.categories || ""
},
set(val) {
// Turn "" to null, because that's how the search service refers to "all categories"
this.search.input.categories = val || null
if (val) {
this.search.input.categories = val
}
// Turn null/"" into "no entry", because not specifying the category
// is how we get the search service to return all categories
else {
delete this.search.input.categories
}
}
},
hasInput() {
Expand Down
Loading