Skip to content

Commit 639d8d2

Browse files
committed
only call onChange if it exists
1 parent 706f42b commit 639d8d2

File tree

1 file changed

+1
-1
lines changed
  • packages/@headlessui-react/src/components/combobox

1 file changed

+1
-1
lines changed

packages/@headlessui-react/src/components/combobox/combobox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ let Input = forwardRefWithAs(function Input<
501501
let handleChange = useCallback(
502502
(event: React.ChangeEvent<HTMLInputElement>) => {
503503
dispatch({ type: ActionTypes.OpenCombobox })
504-
onChangeRef.current(event)
504+
onChangeRef.current?.(event)
505505
},
506506
[dispatch, onChangeRef]
507507
)

0 commit comments

Comments
 (0)