Skip to content

Commit

Permalink
Merge pull request #433 from AppQuality/develop
Browse files Browse the repository at this point in the history
fix: Update options on propchange
  • Loading branch information
d-beezee authored Oct 24, 2024
2 parents cb627a2 + 052413e commit 2d14217
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/stories/dropdowns/autocomplete/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
Option,
OptionValue,
} from "@zendeskgarden/react-dropdowns.next";
import { useCallback, useMemo, useState } from "react";
import { useCallback, useEffect, useMemo, useState } from "react";
import useDebounce from "../../../hooks/useDebounce";
import { OptGroup } from "../optGroup";

Expand Down Expand Up @@ -80,6 +80,8 @@ const Autocomplete = ({
const [_options, setOption] = useState(options);
const debouncedInputValue = useDebounce(inputValue, 300);

useEffect(() => setOption(options), [options]);

// update options isHidden property based on inputValue
const matchingOptions = useMemo(
() =>
Expand Down

0 comments on commit 2d14217

Please sign in to comment.