Skip to content

Commit 9a06c29

Browse files
committed
* add special case for portals handling
1 parent b1164cf commit 9a06c29

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

compat/src/portals.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function Portal(props) {
3939
nodeType: 1,
4040
parentNode: container,
4141
childNodes: [],
42-
contains: () => true,
42+
isPortal: true,
4343
// Technically this isn't needed
4444
appendChild(child) {
4545
this.childNodes.push(child);

src/util.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ export function removeNode(node) {
3535
* @param {import('./index').ContainerNode} node - The node to check for containment within the `parent` subtree.
3636
*/
3737
export function contains(parent, node) {
38+
if ('isPortal' in parent) return true;
39+
3840
while (node) {
3941
if (node === parent) return true;
4042
node = node.parentNode;

0 commit comments

Comments
 (0)