Skip to content

Commit 38195da

Browse files
(Picklist): restore the onClick prop
1 parent 9d8c620 commit 38195da

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/scripts/Picklist.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,7 @@ export type PicklistItemProps = {
629629
disabled?: boolean;
630630
icon?: string;
631631
divider?: 'top' | 'bottom';
632+
onClick?: (e: React.SyntheticEvent) => void;
632633
children?: React.ReactNode;
633634
};
634635

@@ -642,6 +643,7 @@ export const PicklistItem: FC<PicklistItemProps> = ({
642643
disabled,
643644
icon,
644645
divider,
646+
onClick: onClick_,
645647
children,
646648
}) => {
647649
const { values, multiSelect, onSelect, focusedValue, optionIdPrefix } =
@@ -650,9 +652,10 @@ export const PicklistItem: FC<PicklistItemProps> = ({
650652
selected_ ?? (value != null ? values.indexOf(value) >= 0 : false);
651653
const isFocused = focusedValue === value;
652654

653-
const onClick = useEventCallback(() => {
655+
const onClick = useEventCallback((e: React.SyntheticEvent) => {
654656
if (!disabled && value != null) {
655657
onSelect(value);
658+
onClick_?.(e);
656659
}
657660
});
658661

0 commit comments

Comments
 (0)