From b143a6a218f58956e46b6589661c030b19fa7989 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Wed, 30 Oct 2024 13:49:49 +0200 Subject: [PATCH 1/3] Avoid "any" type in TypeaheadSelect template --- .../react-templates/src/components/Select/TypeaheadSelect.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-templates/src/components/Select/TypeaheadSelect.tsx b/packages/react-templates/src/components/Select/TypeaheadSelect.tsx index a2bcd148216..f801c520abe 100644 --- a/packages/react-templates/src/components/Select/TypeaheadSelect.tsx +++ b/packages/react-templates/src/components/Select/TypeaheadSelect.tsx @@ -26,7 +26,7 @@ export interface TypeaheadSelectOption extends Omit { /** @hide Forwarded ref */ - innerRef?: React.Ref; + innerRef?: React.Ref; /** Options of the select */ selectOptions: TypeaheadSelectOption[]; /** Callback triggered on selection. */ @@ -386,7 +386,7 @@ export const TypeaheadSelectBase: React.FunctionComponent }; TypeaheadSelectBase.displayName = 'TypeaheadSelectBase'; -export const TypeaheadSelect = React.forwardRef((props: TypeaheadSelectProps, ref: React.Ref) => ( +export const TypeaheadSelect = React.forwardRef((props: TypeaheadSelectProps, ref: React.Ref) => ( )); From 03f86e5ff8d0dd3a030d44188087adaf30133df6 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Wed, 30 Oct 2024 14:14:32 +0200 Subject: [PATCH 2/3] Don't show "Clear" button without onClearSelection function If there is no such function, nothing will change when clicking that button, and it is less confusing to not show it in that case. --- .../react-templates/src/components/Select/TypeaheadSelect.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-templates/src/components/Select/TypeaheadSelect.tsx b/packages/react-templates/src/components/Select/TypeaheadSelect.tsx index f801c520abe..96cf7efd1b3 100644 --- a/packages/react-templates/src/components/Select/TypeaheadSelect.tsx +++ b/packages/react-templates/src/components/Select/TypeaheadSelect.tsx @@ -349,7 +349,7 @@ export const TypeaheadSelectBase: React.FunctionComponent aria-controls="select-typeahead-listbox" />