diff --git a/packages/react/src/components/Forms/Select/mono.stories.tsx b/packages/react/src/components/Forms/Select/mono.stories.tsx index 2b19f4bf6..c8f26aa26 100644 --- a/packages/react/src/components/Forms/Select/mono.stories.tsx +++ b/packages/react/src/components/Forms/Select/mono.stories.tsx @@ -18,6 +18,7 @@ import { } from ":/components/Forms/Select/stories-utils"; import { Modal, ModalSize, useModal } from ":/components/Modal"; import { Input } from ":/components/Forms/Input"; +import { CunninghamProvider } from ":/components/Provider"; export default { title: "Components/Forms/Select/Mono", @@ -241,6 +242,42 @@ export const SearchableUncontrolledWithAsyncOptionsFetchingAndDefaultValue = ); }; +export const SearchableControlledWithAsyncOptionsFetching = () => { + const [isLoading, setIsLoading] = useState(true); + const [value, setValue] = useState("woodbury"); + + const fetchAsyncOptions = async (context: ContextCallbackFetchOptions) => { + let arrayOptions: Option[] = []; + + setIsLoading(true); + try { + arrayOptions = await fetchOptions(context, OPTIONS, 1000); + } catch (error) { + /* empty */ + } + + setIsLoading(false); + return arrayOptions; + }; + + return ( + +
+
Value = {value}|
+ +