Skip to content

Commit

Permalink
Fix #4423: MultiSelect filterInputAutoFocus prop (#4425)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored May 19, 2023
1 parent 290b03a commit eaae50c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions components/lib/multiselect/MultiSelectBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const MultiSelectBase = {
emptyFilterMessage: null,
filter: false,
filterBy: null,
filterInputAutoFocus: true,
filterLocale: undefined,
filterMatchMode: 'contains',
filterPlaceholder: null,
Expand Down
2 changes: 1 addition & 1 deletion components/lib/multiselect/MultiSelectPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
Expand Down
5 changes: 5 additions & 0 deletions components/lib/multiselect/multiselect.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,11 @@ export interface MultiSelectProps extends Omit<React.DetailedHTMLProps<React.Inp
* @defaultValue label
*/
filterBy?: string | undefined;
/**
* When the panel is opened, it specifies that the filter input should focus automatically.
* @defaultValue true
*/
filterInputAutoFocus?: boolean | undefined;
/**
* Icon of the filter icon.
*/
Expand Down

0 comments on commit eaae50c

Please sign in to comment.