Replies: 2 comments 2 replies
-
|
Great suggestion! This would definitely be a nice enhancement for Teleport. You're right that Teleport currently uses the classic remove/insert pattern which resets element state. The Implementation-wise, it should be pretty straightforward:
The renderer architecture already abstracts DOM operations, so this could be added as a progressive enhancement without breaking anything. One thing to note: Would be cool to see this land - it's one of those small changes that would make a real difference for media-heavy apps. |
Beta Was this translation helpful? Give feedback.
-
|
see #14345 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi team,
I recently came across the new
moveBefore()API, which allows moving DOM nodes without resetting their internal state (e.g., videos keep playing, iframes don't reload).Reference: https://developer.chrome.com/blog/movebefore-api
Currently,
<Teleport>seems to rely on remove/insert, which causes media to reset when the target changes.I was wondering if it might be feasible for Vue to progressively enhance runtime-dom to use moveBefore when available? This would make features like "Picture-in-Picture" (moving a video player to a different container) seamless without needing manual DOM manipulation.
Is this something that would fit into the current renderer architecture?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions