From eaae50c118bd5daa25630d2297defb91d5207fa1 Mon Sep 17 00:00:00 2001 From: Melloware Date: Fri, 19 May 2023 14:00:11 -0400 Subject: [PATCH] Fix #4423: MultiSelect filterInputAutoFocus prop (#4425) --- components/lib/multiselect/MultiSelectBase.js | 1 + components/lib/multiselect/MultiSelectPanel.js | 2 +- components/lib/multiselect/multiselect.d.ts | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/components/lib/multiselect/MultiSelectBase.js b/components/lib/multiselect/MultiSelectBase.js index bf63b93ecd..892bd4903c 100644 --- a/components/lib/multiselect/MultiSelectBase.js +++ b/components/lib/multiselect/MultiSelectBase.js @@ -15,6 +15,7 @@ export const MultiSelectBase = { emptyFilterMessage: null, filter: false, filterBy: null, + filterInputAutoFocus: true, filterLocale: undefined, filterMatchMode: 'contains', filterPlaceholder: null, diff --git a/components/lib/multiselect/MultiSelectPanel.js b/components/lib/multiselect/MultiSelectPanel.js index d6efa7250d..56cca52ce8 100644 --- a/components/lib/multiselect/MultiSelectPanel.js +++ b/components/lib/multiselect/MultiSelectPanel.js @@ -26,7 +26,7 @@ export const MultiSelectPanel = React.memo( const onEntered = () => { props.onEntered(() => { - if (props.filter && filterInputRef.current) { + if (props.filter && props.filterInputAutoFocus && filterInputRef.current) { DomHandler.focus(filterInputRef.current, false); } }); diff --git a/components/lib/multiselect/multiselect.d.ts b/components/lib/multiselect/multiselect.d.ts index 219b0adf8e..1b3dac3c50 100644 --- a/components/lib/multiselect/multiselect.d.ts +++ b/components/lib/multiselect/multiselect.d.ts @@ -263,6 +263,11 @@ export interface MultiSelectProps extends Omit