Skip to content

Conversation

istateside
Copy link
Contributor

@istateside istateside commented Jul 30, 2021

The isNodeInDocument function is used to check if a node was detached during a drag event. It checks to make sure this.document.body is defined, but then checks if document.body contains the given node.

When this library is used within an iframe, document in the global context may not be the same as this.document. This commit updates the check to use this.document.body, which should correctly check against the current context instead of the global document.

The isNodeInDocument function is used to check if a node was detached
during a drag event. It checks to make sure this `this.document.body` is
defined, but then checks if `document.body` contains the given node.

When used within an iframe, `document` in the global context may not be
the same as `this.document`. This commit updates the check to use
`this.document.body`.
@istateside
Copy link
Contributor Author

Hey @darthtrevino , any chance I can get a review on this?

@darthtrevino
Copy link
Member

Looks great, I'll merge on Sunday when I'm back from backpacking

@darthtrevino darthtrevino merged commit ce9a390 into react-dnd:main Aug 6, 2021
@istateside
Copy link
Contributor Author

@darthtrevino sorry for another ping, but could we cut a new release to get this code up for public use?

darthtrevino pushed a commit that referenced this pull request Feb 3, 2022
The isNodeInDocument function is used to check if a node was detached
during a drag event. It checks to make sure this `this.document.body` is
defined, but then checks if `document.body` contains the given node.

When used within an iframe, `document` in the global context may not be
the same as `this.document`. This commit updates the check to use
`this.document.body`.
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.

2 participants