Skip to content

Commit

Permalink
[Search] Don't show "No results" while search is loading (#23809)
Browse files Browse the repository at this point in the history
## Summary & Motivation

As titled

## How I Tested These Changes

If results are loading then don't show the "No results message".

## Changelog [New | Bug | Docs]

NOCHANGELOG
  • Loading branch information
salazarm authored Aug 22, 2024
1 parent d307d1d commit 7f9d220
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ export const SearchDialog = () => {
queryString={queryString}
results={renderedResults}
onClickResult={onClickResult}
searching={loading || state.searching}
/>
</Container>
</Overlay>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,16 @@ export type SearchResultsProps<T extends ResultType> = {
onClickResult: (result: T) => void;
queryString: string;
results: T[];
searching: boolean;
};

export const SearchResults = <T extends ResultType>(props: SearchResultsProps<T>) => {
const {highlight, onClickResult, queryString, results} = props;
const {highlight, onClickResult, queryString, results, searching} = props;

if (!results.length && queryString) {
if (searching) {
return;
}
return <NoResults>No results</NoResults>;
}

Expand Down

1 comment on commit 7f9d220

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for dagit-core-storybook ready!

✅ Preview
https://dagit-core-storybook-1n9rcna3a-elementl.vercel.app

Built with commit 7f9d220.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.