Skip to content

Commit f1249f9

Browse files
committed
add same fix to useCalendarCell
1 parent 64eece8 commit f1249f9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/@react-aria/calendar/src/useCalendarCell.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,13 @@ export function useCalendarCell(props: AriaCalendarCellProps, state: CalendarSta
338338
// outside the original pressed element.
339339
// (JSDOM does not support this)
340340
if ('releasePointerCapture' in e.target) {
341-
e.target.releasePointerCapture(e.pointerId);
341+
if ('hasPointerCapture' in e.target) {
342+
if (e.target.hasPointerCapture(e.pointerId)) {
343+
e.target.releasePointerCapture(e.pointerId);
344+
}
345+
} else {
346+
e.target.releasePointerCapture(e.pointerId);
347+
}
342348
}
343349
},
344350
onContextMenu(e) {

0 commit comments

Comments
 (0)