We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b1164cf commit 9a06c29Copy full SHA for 9a06c29
compat/src/portals.js
@@ -39,7 +39,7 @@ function Portal(props) {
39
nodeType: 1,
40
parentNode: container,
41
childNodes: [],
42
- contains: () => true,
+ isPortal: true,
43
// Technically this isn't needed
44
appendChild(child) {
45
this.childNodes.push(child);
src/util.js
@@ -35,6 +35,8 @@ export function removeNode(node) {
35
* @param {import('./index').ContainerNode} node - The node to check for containment within the `parent` subtree.
36
*/
37
export function contains(parent, node) {
38
+ if ('isPortal' in parent) return true;
+
while (node) {
if (node === parent) return true;
node = node.parentNode;
0 commit comments