Skip to content

Commit 1241371

Browse files
consider cases without value on executing onClick()
1 parent 2f64367 commit 1241371

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/scripts/Picklist.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -677,10 +677,14 @@ export const PicklistItem: FC<PicklistItemProps> = ({
677677
const isFocused = value != null && focusedValue === value;
678678

679679
const onClick = useEventCallback((e: React.SyntheticEvent) => {
680-
if (!disabled && value != null) {
680+
if (disabled) {
681+
return;
682+
}
683+
684+
if (value != null) {
681685
onSelect(value);
682-
onClick_?.(e);
683686
}
687+
onClick_?.(e);
684688
});
685689

686690
const itemClassNames = classnames(

0 commit comments

Comments
 (0)