Skip to content

Commit

Permalink
fix: add null protection for onDatePick callback (#2045)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvir-pollinger committed May 3, 2024
1 parent f92fbc1 commit 0969003
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/core/src/components/DatePicker/DatePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ const DatePicker: VibeComponent<DatePickerProps, HTMLElement> = forwardRef<HTMLD

const onDateRangeChange = useCallback(
(date: RangeDate) => {
if (!onPickDate) return;
if (focusedInput === FocusInput.startDate) {
onPickDate({ ...date, endDate: null });
} else {
Expand Down

0 comments on commit 0969003

Please sign in to comment.