diff --git a/.changeset/fast-eels-sell.md b/.changeset/fast-eels-sell.md new file mode 100644 index 00000000000..16dc33720c0 --- /dev/null +++ b/.changeset/fast-eels-sell.md @@ -0,0 +1,5 @@ +--- +"@talend/design-system": patch +--- + +Fix issue with Select component being recreated instead of updated diff --git a/packages/design-system/src/components/Form/Field/Select/Select.tsx b/packages/design-system/src/components/Form/Field/Select/Select.tsx index 22d0101e7e4..95019ec82bb 100644 --- a/packages/design-system/src/components/Form/Field/Select/Select.tsx +++ b/packages/design-system/src/components/Form/Field/Select/Select.tsx @@ -1,18 +1,25 @@ -import { forwardRef, Children } from 'react'; +import { Children, forwardRef } from 'react'; import type { Ref } from 'react'; import { isElement } from 'react-is'; -import Input from '../Input'; + +import { useId } from '../../../../useId'; import { FieldPrimitive, FieldPropsPrimitive, SelectPrimitive, SelectPrimitiveProps, } from '../../Primitives'; -import { useId } from '../../../../useId'; +import Input from '../Input'; export type SelectProps = FieldPropsPrimitive & Omit & { readOnly?: boolean }; +const SelectField = forwardRef((fieldProps: SelectProps, ref: Ref) => { + return ; +}); + +SelectField.displayName = 'SelectField'; + const Select = forwardRef((props: SelectProps, ref: Ref) => { const { label, @@ -69,18 +76,6 @@ const Select = forwardRef((props: SelectProps, ref: Ref) { - return ( - } - > - {children} - - ); - } - return ( + > + {children} + ); });