Skip to content

Commit

Permalink
Merge pull request #1966 from sophieturner0/FilterSearch-modal-should…
Browse files Browse the repository at this point in the history
…-close-automatically

After Clicking Show Result Button, `[FilterSearch]` Modal Does Not  `Automatically`
  • Loading branch information
Rassl authored Sep 13, 2024
2 parents 8b095e6 + 8676673 commit 66f7fd2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/App/SideBar/FilterSearch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type Props = {
setShowAllSchemas: (value: boolean) => void
schemaAll: SchemaExtended[]
anchorEl: HTMLElement | null
setAnchorEl: (value: HTMLElement | null) => void
}

const defaultValues = {
Expand All @@ -26,7 +27,7 @@ const defaultValues = {
maxResults: 30,
}

export const FilterSearch = ({ showAllSchemas, setShowAllSchemas, schemaAll, anchorEl }: Props) => {
export const FilterSearch = ({ showAllSchemas, setShowAllSchemas, schemaAll, anchorEl, setAnchorEl }: Props) => {
const handleSchemaTypeClick = (type: string) => {
setSelectedTypes((prevSelectedTypes) =>
prevSelectedTypes.includes(type) ? prevSelectedTypes.filter((t) => t !== type) : [...prevSelectedTypes, type],
Expand Down Expand Up @@ -63,6 +64,8 @@ export const FilterSearch = ({ showAllSchemas, setShowAllSchemas, schemaAll, anc
top_node_count: sourceNodes.toString(),
})

setAnchorEl(null)

await fetchData(setBudget, setAbortRequests)
}

Expand Down
1 change: 1 addition & 0 deletions src/components/App/SideBar/RegularView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export const RegularView = () => {
<FilterSearch
anchorEl={anchorEl}
schemaAll={schemaAll}
setAnchorEl={setAnchorEl}
setShowAllSchemas={setShowAllSchemas}
showAllSchemas={showAllSchemas}
/>
Expand Down

0 comments on commit 66f7fd2

Please sign in to comment.