Skip to content

Commit

Permalink
fix: fix search bar error with new docusaurus
Browse files Browse the repository at this point in the history
fixes #77
  • Loading branch information
weareoutman committed Apr 21, 2021
1 parent d7a05ed commit ed5db80
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/client/theme/SearchBar/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ import { SearchSourceFactory } from "../../utils/SearchSourceFactory";
import { SuggestionTemplate } from "./SuggestionTemplate";
import { EmptyTemplate } from "./EmptyTemplate";
import { SearchResult } from "../../../shared/interfaces";
import { searchResultLimits, Mark, translations } from "../../utils/proxiedGenerated";
import {
searchResultLimits,
Mark,
translations,
} from "../../utils/proxiedGenerated";
import LoadingRing from "../LoadingRing/LoadingRing";

import styles from "./SearchBar.module.css";
Expand All @@ -30,7 +34,7 @@ const SEARCH_PARAM_HIGHLIGHT = "_highlight";

interface SearchBarProps {
isSearchBarExpanded: boolean;
handleSearchBarToggle: (expanded: boolean) => void;
handleSearchBarToggle?: (expanded: boolean) => void;
}

export default function SearchBar({
Expand Down Expand Up @@ -164,11 +168,11 @@ export default function SearchBar({
const onInputFocus = useCallback(() => {
focusAfterIndexLoaded.current = true;
loadIndex();
handleSearchBarToggle(true);
handleSearchBarToggle?.(true);
}, [handleSearchBarToggle, loadIndex]);

const onInputBlur = useCallback(() => {
handleSearchBarToggle(false);
handleSearchBarToggle?.(false);
}, [handleSearchBarToggle]);

const onInputMouseEnter = useCallback(() => {
Expand Down

0 comments on commit ed5db80

Please sign in to comment.