mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
Fix top-level reconciliation in portals (#3020)
This commit is contained in:
parent
772763c2e2
commit
d7f988055f
@ -86,7 +86,7 @@ impl Reconcilable for VPortal {
|
||||
self,
|
||||
_root: &BSubtree,
|
||||
parent_scope: &AnyScope,
|
||||
parent: &Element,
|
||||
_parent: &Element,
|
||||
next_sibling: NodeRef,
|
||||
portal: &mut Self::Bundle,
|
||||
) -> NodeRef {
|
||||
@ -110,8 +110,8 @@ impl Reconcilable for VPortal {
|
||||
node.reconcile_node(
|
||||
&portal.inner_root,
|
||||
parent_scope,
|
||||
parent,
|
||||
next_sibling.clone(),
|
||||
&portal.host,
|
||||
portal.inner_sibling.clone(),
|
||||
&mut portal.node,
|
||||
);
|
||||
next_sibling
|
||||
@ -181,6 +181,21 @@ mod layout_tests {
|
||||
},
|
||||
expected: "<div><i></i><o>PORTAL</o>AFTER</div>",
|
||||
});
|
||||
layouts.push(TestLayout {
|
||||
name: "Portal - update inner content",
|
||||
node: html! {
|
||||
<div>
|
||||
{VNode::VRef(first_target.clone().into())}
|
||||
{VNode::VRef(second_target.clone().into())}
|
||||
{VNode::VPortal(VPortal::new(
|
||||
html! { <> {"PORTAL"} <b /> </> },
|
||||
second_target.clone(),
|
||||
))}
|
||||
{"AFTER"}
|
||||
</div>
|
||||
},
|
||||
expected: "<div><i></i><o>PORTAL<b></b></o>AFTER</div>",
|
||||
});
|
||||
layouts.push(TestLayout {
|
||||
name: "Portal - replaced by text",
|
||||
node: html! {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user