Check that this is really a bug
Reproduction link
https://codesandbox.io/p/sandbox/d5hvhs
Bug description
Selection attaches its mouse/drag listeners and runs document.elementFromPoint
hit-testing and pageOffset scroll math against the module-global document/window.
When a calendar is rendered into a different document (e.g. a React portal into a
window.open window, or an iframe), those listeners are bound to the host page's
document and never receive the events fired in the calendar's own window. Result:
event move/resize and drag-from-outside silently do nothing. Ordinary clicks and other
React-handled interactions still work (React delegates synthetic events to the portal
correctly), only RBC's own native listeners are mis-targeted.
To Reproduce
- Render
withDragAndDrop(Calendar) into a portal whose container lives in a
separate window.open document.
- Try to move/resize an event, or drag an external item onto the calendar.
- Nothing happens (the same calendar works in-page).
Expected Behavior
Drag/resize/drop work regardless of which document the calendar is rendered into.
Actual Behavior
Drag/resize/drop do not work in the other document.
react-big-calendar version
1.20.0
React version
19.2.4
Platform/Target and Browser Versions
macOS Chrome 149.0.7827.199
Validations
Would you like to open a PR for this bug?
Check that this is really a bug
Reproduction link
https://codesandbox.io/p/sandbox/d5hvhs
Bug description
Selectionattaches its mouse/drag listeners and runsdocument.elementFromPointhit-testing and
pageOffsetscroll math against the module-globaldocument/window.When a calendar is rendered into a different document (e.g. a React portal into a
window.openwindow, or an iframe), those listeners are bound to the host page'sdocument and never receive the events fired in the calendar's own window. Result:
event move/resize and drag-from-outside silently do nothing. Ordinary clicks and other
React-handled interactions still work (React delegates synthetic events to the portal
correctly), only RBC's own native listeners are mis-targeted.
To Reproduce
withDragAndDrop(Calendar)into a portal whose container lives in aseparate
window.opendocument.Expected Behavior
Drag/resize/drop work regardless of which document the calendar is rendered into.
Actual Behavior
Drag/resize/drop do not work in the other document.
react-big-calendar version
1.20.0
React version
19.2.4
Platform/Target and Browser Versions
macOS Chrome 149.0.7827.199
Validations
Would you like to open a PR for this bug?