diff --git a/src/stories/dropdowns/autocomplete/index.tsx b/src/stories/dropdowns/autocomplete/index.tsx index cd0deb5e..b69aecd5 100644 --- a/src/stories/dropdowns/autocomplete/index.tsx +++ b/src/stories/dropdowns/autocomplete/index.tsx @@ -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"; @@ -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( () =>