Skip to content

Commit 82feda0

Browse files
committed
Fix event handler logic in Select
1 parent 5c9b4cd commit 82feda0

File tree

1 file changed

+2
-8
lines changed
  • packages/components/src/components/Select

1 file changed

+2
-8
lines changed

packages/components/src/components/Select/index.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,12 @@ export function Select({
8787
}, [open, setOpen])
8888

8989
const handleOpenChange = (open: boolean) => {
90-
if (onOpenChange) {
91-
onOpenChange(open)
92-
return
93-
}
90+
onOpenChange?.(open)
9491
setOpen(open)
9592
}
9693

9794
const handleValueChange = (nextValue: string) => {
98-
if (onValueChange) {
99-
onValueChange(nextValue)
100-
return
101-
}
95+
onValueChange?.(nextValue)
10296

10397
if (type === 'default') return
10498
if (type === 'radio') {

0 commit comments

Comments
 (0)