diff --git a/apps/docs/content/components/select/open-state.ts b/apps/docs/content/components/select/open-state.ts index be01dc5195..b1977ace5b 100644 --- a/apps/docs/content/components/select/open-state.ts +++ b/apps/docs/content/components/select/open-state.ts @@ -39,6 +39,7 @@ export default function App() { label="Favorite Animal" placeholder="Select an animal" defaultSelectedKeys={["cat"]} + onOpenChange={(open) => open !== isOpen && setIsOpen(open)} className="max-w-xs" > {animals.map((animal) => ( diff --git a/packages/components/select/package.json b/packages/components/select/package.json index 8dd2cafa2a..70db04d000 100644 --- a/packages/components/select/package.json +++ b/packages/components/select/package.json @@ -60,6 +60,7 @@ "devDependencies": { "@nextui-org/theme": "workspace:*", "@nextui-org/system": "workspace:*", + "@nextui-org/button": "workspace:*", "@nextui-org/avatar": "workspace:*", "@nextui-org/input": "workspace:*", "@nextui-org/chip": "workspace:*", diff --git a/packages/components/select/stories/select.stories.tsx b/packages/components/select/stories/select.stories.tsx index 2a6c7c7e98..1e5d4351c6 100644 --- a/packages/components/select/stories/select.stories.tsx +++ b/packages/components/select/stories/select.stories.tsx @@ -5,6 +5,7 @@ import {select, button} from "@nextui-org/theme"; import {PetBoldIcon, SelectorIcon} from "@nextui-org/shared-icons"; import {Avatar} from "@nextui-org/avatar"; import {Chip} from "@nextui-org/chip"; +import {Button} from "@nextui-org/button"; import {Selection} from "@react-types/shared"; import {useInfiniteScroll} from "@nextui-org/use-infinite-scroll"; import { @@ -211,17 +212,12 @@ const ControlledOpenTemplate = ({color, variant, ...args}: SelectProps) isOpen={isOpen} label="Favorite Animal" variant={variant} + onOpenChange={(open) => open !== isOpen && setIsOpen(open)} {...args} > {items} - + ); }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dd8ba8d279..3424af68d3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2032,6 +2032,9 @@ importers: '@nextui-org/avatar': specifier: workspace:* version: link:../avatar + '@nextui-org/button': + specifier: workspace:* + version: link:../button '@nextui-org/chip': specifier: workspace:* version: link:../chip