Skip to content

Commit

Permalink
feat(react-select): use react-select version 4.3.1 (#2184)
Browse files Browse the repository at this point in the history
  • Loading branch information
YossiSaadi authored Jun 26, 2024
1 parent 6bc7748 commit c90b6dd
Show file tree
Hide file tree
Showing 5 changed files with 454 additions and 192 deletions.
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@
"react-inlinesvg": "^3.0.1",
"react-is": "^16.9.0",
"react-popper": "^2.3.0",
"react-select": "^3.2.0",
"react-select": "^4.3.1",
"react-transition-group": "^4.4.5",
"react-virtualized-auto-sizer": "^1.0.7",
"react-window": "^1.8.7",
"react-windowed-select": "^2.0.4",
"react-windowed-select": "^3.1.2",
"style-inject": "^0.3.0",
"vibe-storybook-components": "0.19.0"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/components/Dropdown/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,8 @@ const Dropdown: VibeComponent<DropdownComponentProps, HTMLElement> & {
);
const onChange = (option: DropdownOption | DropdownOption[], meta: ActionMeta<DropdownOption>) => {
if (customOnChange) {
customOnChange(option, meta);
const newValue = multi ? (option.length > 0 ? option : null) : option;
customOnChange(newValue, meta);
}

switch (meta.action) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ describe("Dropdown", () => {

expect(onChange).toBeCalledTimes(2);
expect(onChange).toHaveBeenLastCalledWith(null, {
action: "clear"
action: "clear",
removedValues: [mockOptions[0]]
});
expect(onClear).toBeCalled();
expect(component.chips.values).toEqual([]);
Expand Down
Loading

0 comments on commit c90b6dd

Please sign in to comment.