Skip to content

Commit

Permalink
Fix search loading state (#2684)
Browse files Browse the repository at this point in the history
  • Loading branch information
clairechabas authored Jan 8, 2025
1 parent 82dc9c4 commit 300f7bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/silly-books-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'gitbook': patch
---

Fix search loading state
2 changes: 1 addition & 1 deletion packages/gitbook/src/components/Search/SearchResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export const SearchResults = React.forwardRef(function SearchResults(
[moveBy, select],
);

if (!results) {
if (!results?.some((result) => result.type !== 'question')) {
if (query) {
return (
<div className={tcls('flex', 'items-center', 'justify-center', 'py-8')}>
Expand Down

0 comments on commit 300f7bf

Please sign in to comment.