Skip to content

Commit bd3418e

Browse files
authored
PickerItem in multi mode - send selected to onPress (wix#2537)
1 parent 19bf959 commit bd3418e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/components/picker/PickerItem.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const PickerItem = (props: PickerItemProps) => {
6363
}, [isItemDisabled, labelStyle]);
6464

6565
const _onPress = useCallback(() => {
66-
onPress?.();
66+
onPress?.(context.isMultiMode ? !isSelected : undefined);
6767
if (migrate) {
6868
context.onPress(value);
6969
} else {

src/components/picker/types.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,9 @@ export interface PickerItemProps {
237237
disabled?: boolean;
238238
/**
239239
* Callback for onPress action
240+
* @param selected true\false in multi mode and undefined in single mode
240241
*/
241-
onPress?: () => void;
242+
onPress?: (selected?: boolean) => void;
242243
/**
243244
* Component test id
244245
*/

0 commit comments

Comments
 (0)