Skip to content

Commit 02bdfab

Browse files
committed
Revert "stop overlay trigger state context in s2 calendar popover"
This reverts commit f6d2eac.
1 parent f6d2eac commit 02bdfab

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

packages/@react-spectrum/s2/src/DatePicker.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import {
1919
DateValue,
2020
Dialog,
2121
FormContext,
22-
OverlayTriggerStateContext,
2322
Provider,
2423
TimeValue
2524
} from 'react-aria-components';
@@ -242,12 +241,7 @@ export function CalendarPopover(props: PropsWithChildren): ReactElement {
242241
gap: 16
243242
})}>
244243
<Dialog>
245-
<Provider
246-
values={[
247-
[OverlayTriggerStateContext, null]
248-
]}>
249-
{props.children}
250-
</Provider>
244+
{props.children}
251245
</Dialog>
252246
</PopoverBase>
253247
);

packages/react-aria-components/src/Calendar.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ export const CalendarCell = /*#__PURE__*/ (forwardRef as forwardRefType)(functio
507507
let state = calendarState ?? rangeCalendarState!;
508508
let {startDate: currentMonth} = useContext(InternalCalendarGridContext) ?? {startDate: state.visibleRange.start};
509509
let isOutsideMonth = !isSameMonth(currentMonth, date);
510+
// TODO: check api with team, this seemed useful though
510511
let istoday = isToday(date, state.timeZone);
511512

512513
let buttonRef = useRef<HTMLDivElement>(null);

packages/react-aria-components/src/DatePicker.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export const DatePickerStateContext = createContext<DatePickerState | null>(null
7474
export const DateRangePickerStateContext = createContext<DateRangePickerState | null>(null);
7575

7676
// Contexts to clear inside the popover.
77-
const CLEAR_CONTEXTS = [GroupContext, ButtonContext, LabelContext, TextContext];
77+
const CLEAR_CONTEXTS = [GroupContext, ButtonContext, LabelContext, TextContext, OverlayTriggerStateContext];
7878

7979
/**
8080
* A date picker combines a DateField and a Calendar popover to allow users to enter or select a date and time value.
@@ -173,7 +173,7 @@ export const DatePicker = /*#__PURE__*/ (forwardRef as forwardRefType)(function
173173
data-focus-visible={isFocusVisible || undefined}
174174
data-disabled={props.isDisabled || undefined}
175175
data-open={state.isOpen || undefined} />
176-
<HiddenDateInput
176+
<HiddenDateInput
177177
autoComplete={props.autoComplete}
178178
name={props.name}
179179
isDisabled={props.isDisabled}

0 commit comments

Comments
 (0)