Skip to content

fix(Selection): bind drag listeners to the container's ownerDocument#2810

Open
gagehohwart wants to merge 1 commit into
bigcalendar:masterfrom
gagehohwart:fix/selection-owner-document
Open

fix(Selection): bind drag listeners to the container's ownerDocument#2810
gagehohwart wants to merge 1 commit into
bigcalendar:masterfrom
gagehohwart:fix/selection-owner-document

Conversation

@gagehohwart

Copy link
Copy Markdown

Fixes #2809

Selection attaches its mouse/drag listeners and runs element hit-testing against the module-global document/window. When the calendar is rendered into a different document (a React portal into a separate window.open window or an iframe), those listeners are bound to the wrong document and never receive the events fired in the calendar's actual window. Event move/resize and drag-from-outside silently stop working (ordinary clicks keep working because React delegates synthetic events correctly).

Resolve the owning document/window from the container node's ownerDocument and attach all listeners and measurements there. For the normal in-page calendar this resolves to the global document/window, so behavior is unchanged.

Selection attaches its mouse/drag listeners and runs element hit-testing
against the module-global `document`/`window`. When the calendar is
rendered into a different document (a React portal into a separate
`window.open` window or an iframe), those listeners are bound to the wrong
document and never receive the events fired in the calendar's actual
window. Event move/resize and drag-from-outside silently stop working
(ordinary clicks keep working because React delegates synthetic events
correctly).

Resolve the owning document/window from the container node's
`ownerDocument` and attach all listeners and measurements there. For the
normal in-page calendar this resolves to the global document/window, so
behavior is unchanged.

Closes bigcalendar#2809
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drag/drop stops working when the calendar is rendered into another document (portal to a separate window or iframe)

1 participant