Skip to content

Commit

Permalink
fix(ListPicker): onMultipleChange 的调用方法
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhang Rui committed Mar 18, 2024
1 parent 0f40da6 commit e780c25
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/list-picker/listPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,12 @@ export const ListPicker: React.FC<ListPickerProps> = (props) => {
// use confirm,when without onconfirm click, return prevValue
if (needConfirm && !visible && !isEqual(controlledValue, value)) {
setValue(prevValue);
if (model === 'multiple') {
onMultipleChange?.(prevValue as any[]);
}
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [visible, needConfirm, controlledValue, value]);
}, [visible, needConfirm, controlledValue, value, model]);

// recent
const setRecentValue = (val?: string | string[]) => {
Expand Down

0 comments on commit e780c25

Please sign in to comment.