Skip to content

Commit

Permalink
fix: filterable multiselect search issue (#16729)
Browse files Browse the repository at this point in the history
* fix: filterable multiselect search issue

* fix: removed consoles

* fix: removed test story
  • Loading branch information
riddhybansal authored Jun 19, 2024
1 parent 7517c3b commit 763e480
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,6 @@ const FilterableMultiSelect = React.forwardRef(function FilterableMultiSelect<
if (changes.isOpen && !isOpen) {
setTopItems(controlledSelectedItems);
}

switch (type) {
case InputKeyDownEnter:
if (changes.selectedItem && changes.selectedItem.disabled !== true) {
Expand All @@ -465,6 +464,8 @@ const FilterableMultiSelect = React.forwardRef(function FilterableMultiSelect<
return changes;
case InputBlur:
case InputKeyDownEscape:
setInputFocused(false);
setInputValue('');
setIsOpen(false);
return changes;
case FunctionToggleMenu:
Expand Down Expand Up @@ -659,10 +660,6 @@ const FilterableMultiSelect = React.forwardRef(function FilterableMultiSelect<
}
},
onFocus: () => setInputFocused(true),
onBlur() {
setInputFocused(false);
setInputValue('');
},
})
);
const menuProps = getMenuProps({}, { suppressRefError: true });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import MultiSelect from '.';
import FilterableMultiSelect from './FilterableMultiSelect';
import Button from '../Button';
import ButtonSet from '../ButtonSet';
import { Tabs, Tab, TabList, TabPanels, TabPanel } from '@carbon/react';

export default {
title: 'Components/MultiSelect',
Expand Down

0 comments on commit 763e480

Please sign in to comment.