Skip to content

Commit

Permalink
disable search bar when section hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
bprize15 committed Nov 19, 2024
1 parent 89269a2 commit bc5da0c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion web/src/main/javascript/src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default function Header({
}}
>
<SearchBySelect />
<SearchBar oncoTreeData={oncoTreeData} oncoTree={oncoTree} />
<SearchBar oncoTreeData={oncoTreeData} oncoTree={oncoTree} disabled={searchSectionHidden} />
<div style={{ marginRight: 20 }} />
<VersionSelect
onVersionChange={onVersionChange}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export interface ISearchBarProps {
oncoTreeData: OncoTreeNode;
oncoTree: OncoTree | undefined;
mobileView?: boolean;
disabled?: boolean;
}

const NEXT_BUTTON_DATA_TYPE = "nextButton";
Expand All @@ -40,6 +41,7 @@ export default function SearchBar({
oncoTreeData,
oncoTree,
mobileView = false,
disabled = false,
}: ISearchBarProps) {
const [searchParams, setSearchParams] = useSearchParams();
const search = searchParams.get("search");
Expand Down Expand Up @@ -205,6 +207,7 @@ export default function SearchBar({
<ReactSelect
inputValue={input}
value={getSearchBarValue()}
isDisabled={disabled}
placeholder={
isValidField(field)
? SEARCH_BY_FIELD_INFO[field].searchBarPlaceHolder
Expand Down

0 comments on commit bc5da0c

Please sign in to comment.