Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ More examples can be found [here ↗](https://react-multi-select-component.pages
| `isLoading` | show spinner on select | `boolean` | `false` |
| `shouldToggleOnHover` | toggle dropdown on hover option | `boolean` | `false` |
| `overrideStrings` | [localization ↗](stories/recipes/localization.stories.mdx) | `object` | |
| `onBlur` | onBlur callback | `function` | |
| `onChange` | onChange callback | `function` | |
| `disabled` | disable dropdown | `boolean` | `false` |
| `disableSearch` | hide search textbox | `boolean` | `false` |
Expand Down
2 changes: 2 additions & 0 deletions src/multi-select/dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const Dropdown = () => {
isLoading,
disabled,
onChange,
onBlur,
labelledBy,
value,
isOpen,
Expand Down Expand Up @@ -90,6 +91,7 @@ const Dropdown = () => {
if (!e.currentTarget.contains(e.relatedTarget) && isInternalExpand) {
setHasFocus(false);
setExpanded(false);
onBlur?.(e);
}
};

Expand Down
3 changes: 3 additions & 0 deletions stories/basic.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export const ExampleDefault = () => {
value={selected}
disabled={boolean("disabled", false)}
onChange={setSelected}
onBlur={() => {
console.debug("input blurred");
}}
onMenuToggle={(s) => {
console.debug("Select Toggle: ", s);
}}
Expand Down