-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Labels
Description
Not sure if we want this issue here or in nanomorph, but looks like proxy nodes are leaked when a component is morphed to a new location in the dom. For example, if these two views are morphed, a proxy node will be rendered rather than the component:
function viewA (state, emit) {
return html`
<body>
<a href="/">beep</a>
<a href="/boop">boop</a>
<div>
${component.render()}
</div>
</body>
`
}
function viewB (state, emit) {
return html`
<body>
<a href="/">beep</a>
<a href="/boop">boop</a>
${component.render()}
</body>
`
}You can see this behavior here:
- Demo: https://choo-leaky-proxy.glitch.me
- Code: https://glitch.com/edit/#!/choo-leaky-proxy?path=index.js:1:0
Also interesting to note if the component's update function returns true, the component will leak the proxy node on first morph, while subsequent morphs will correctly return the component.
s3ththompson, hdriqi and bennlich