Skip to content

Commit f6d2eac

Browse files
committed
stop overlay trigger state context in s2 calendar popover
1 parent 7639e56 commit f6d2eac

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
DateValue,
2020
Dialog,
2121
FormContext,
22+
OverlayTriggerStateContext,
2223
Provider,
2324
TimeValue
2425
} from 'react-aria-components';
@@ -241,7 +242,12 @@ export function CalendarPopover(props: PropsWithChildren): ReactElement {
241242
gap: 16
242243
})}>
243244
<Dialog>
244-
{props.children}
245+
<Provider
246+
values={[
247+
[OverlayTriggerStateContext, null]
248+
]}>
249+
{props.children}
250+
</Provider>
245251
</Dialog>
246252
</PopoverBase>
247253
);

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,6 @@ 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
511510
let istoday = isToday(date, state.timeZone);
512511

513512
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, OverlayTriggerStateContext];
77+
const CLEAR_CONTEXTS = [GroupContext, ButtonContext, LabelContext, TextContext];
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)