@@ -14,14 +14,14 @@ import {AriaButtonProps} from '@react-types/button';
14
14
import { AriaDatePickerProps , AriaDateRangePickerProps , DateValue } from '@react-types/datepicker' ;
15
15
import { AriaDialogProps } from '@react-types/dialog' ;
16
16
import { createFocusManager } from '@react-aria/focus' ;
17
+ import { DateRange , RangeCalendarProps } from '@react-types/calendar' ;
17
18
import { DateRangePickerState } from '@react-stately/datepicker' ;
18
19
import { DEFAULT_VALIDATION_RESULT , mergeValidation , privateValidationStateProp } from '@react-stately/form' ;
19
20
import { DOMAttributes , GroupDOMAttributes , KeyboardEvent , RefObject , ValidationResult } from '@react-types/shared' ;
20
21
import { filterDOMProps , mergeProps , useDescription , useId } from '@react-aria/utils' ;
21
22
import { focusManagerSymbol , roleSymbol } from './useDateField' ;
22
23
// @ts -ignore
23
24
import intlMessages from '../intl/*.json' ;
24
- import { RangeCalendarProps } from '@react-types/calendar' ;
25
25
import { useDatePickerGroup } from './useDatePickerGroup' ;
26
26
import { useField } from '@react-aria/label' ;
27
27
import { useFocusWithin } from '@react-aria/interactions' ;
@@ -168,7 +168,7 @@ export function useDateRangePicker<T extends DateValue>(props: AriaDateRangePick
168
168
startFieldProps : {
169
169
...startFieldProps ,
170
170
...commonFieldProps ,
171
- value : state . value ?. start ,
171
+ value : state . value ?. start ?? null ,
172
172
onChange : start => state . setDateTime ( 'start' , start ) ,
173
173
autoFocus : props . autoFocus ,
174
174
name : props . startName ,
@@ -186,7 +186,7 @@ export function useDateRangePicker<T extends DateValue>(props: AriaDateRangePick
186
186
endFieldProps : {
187
187
...endFieldProps ,
188
188
...commonFieldProps ,
189
- value : state . value ?. end ,
189
+ value : state . value ?. end ?? null ,
190
190
onChange : end => state . setDateTime ( 'end' , end ) ,
191
191
name : props . endName ,
192
192
[ privateValidationStateProp ] : {
@@ -204,7 +204,7 @@ export function useDateRangePicker<T extends DateValue>(props: AriaDateRangePick
204
204
errorMessageProps,
205
205
calendarProps : {
206
206
autoFocus : true ,
207
- value : state . dateRange ,
207
+ value : state . dateRange ?. start && state . dateRange . end ? state . dateRange as DateRange : null ,
208
208
onChange : state . setDateRange ,
209
209
minValue : props . minValue ,
210
210
maxValue : props . maxValue ,
0 commit comments