Skip to content

Commit

Permalink
fix(MultiCombobox): fix clear value function (#959)
Browse files Browse the repository at this point in the history
issue -  #925
  • Loading branch information
azhadanov committed Mar 10, 2021
1 parent cb01310 commit 64e428c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/MultiCombobox/MultiCombobox.tsx
Expand Up @@ -20,7 +20,7 @@ export const multiComboboxPropSizeDefault = multiComboboxPropSize[0];

export type MultiComboboxProps<ITEM, GROUP> = Omit<CommonSelectProps<ITEM>, 'options'> &
Omit<SelectContainerProps, 'value' | 'onChange'> & {
onChange?: (v: ITEM[] | null) => void;
onChange?: (values: ITEM[] | null) => void;
onCreate?: (str: string) => void;
labelForCreate?: string;
labelForNotFound?: string;
Expand Down Expand Up @@ -79,9 +79,9 @@ export const MultiCombobox: MultiCombobox = (props) => {
const controlInnerRef = useRef<HTMLDivElement>(null);
const helperInputFakeElement = useRef<HTMLDivElement>(null);

const handlerChangeValue = (v: Items): void => {
if (typeof onChange === 'function' && v) {
onChange(v);
const handlerChangeValue = (values: Items): void => {
if (typeof onChange === 'function' && values) {
onChange(values.length === 0 ? null : values);
}
setInputData({ value: toggleRef.current?.value });
};
Expand Down

0 comments on commit 64e428c

Please sign in to comment.