diff --git a/.changeset/few-fishes-sip.md b/.changeset/few-fishes-sip.md new file mode 100644 index 000000000..f57f8257f --- /dev/null +++ b/.changeset/few-fishes-sip.md @@ -0,0 +1,5 @@ +--- +'@strapi/design-system': minor +--- + +feat: add onCloseAutoFocus to Select diff --git a/packages/strapi-design-system/src/Select/MultiSelect.tsx b/packages/strapi-design-system/src/Select/MultiSelect.tsx index 741aa02a0..222711e3d 100644 --- a/packages/strapi-design-system/src/Select/MultiSelect.tsx +++ b/packages/strapi-design-system/src/Select/MultiSelect.tsx @@ -17,6 +17,7 @@ import { Tag } from '../Tag'; import { Typography } from '../Typography'; type MultiSelectPropsWithoutLabel = Omit & + Pick & Pick & Pick & { /** @@ -55,6 +56,7 @@ export const MultiSelect = React.forwardRef( labelAction, onChange, onClear, + onCloseAutoFocus, onReachEnd, placeholder, required, @@ -197,7 +199,7 @@ export const MultiSelect = React.forwardRef( - + {children} diff --git a/packages/strapi-design-system/src/Select/SingleSelect.tsx b/packages/strapi-design-system/src/Select/SingleSelect.tsx index 45f3f1c54..b5f626023 100644 --- a/packages/strapi-design-system/src/Select/SingleSelect.tsx +++ b/packages/strapi-design-system/src/Select/SingleSelect.tsx @@ -11,6 +11,7 @@ import { useIntersection } from '../hooks/useIntersection'; import { Typography } from '../Typography'; type SingleSelectPropsWithoutLabel = Omit & + Pick & Pick & Pick & { /** @@ -41,7 +42,6 @@ export const SingleSelect = React.forwardRef { const generatedId = useId(id); - /** * Because the trigger needs to be a `div` to allow the clear * button & tags to be clickable, we need to manually focus it. @@ -98,6 +98,7 @@ export const SingleSelectInput = React.forwardRef - + {children}