$teleport helper #46
-
Discussion about $teleport helperPurpose of It feels like Alpine might gain some templating power with this helper. Topics
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 10 replies
-
|
Beta Was this translation helpful? Give feedback.
-
Besides that, I don't think this will even be possible given how Alpine watches and updates state. |
Beta Was this translation helpful? Give feedback.
-
It could be useful, however, to transport entire components. For example, imagine an a slideshow slider that when clicked on you transport it to a modal lightbox type component, with the state in tact. Currently you can do this easily enough by passing the state over manually, but a helper to make it intuitive would be good. You'd have to consider whether the component can get back "home" as well. I think it should. |
Beta Was this translation helpful? Give feedback.
-
Maybe this could be a second helper (think |
Beta Was this translation helpful? Give feedback.
-
If no one is against it, let's keep it teleport.
I think we got it working as expected now. Reactivity works both way even teleported element is not a component. It's still watches changes on initial component and updates itself if any updates.
For now it teleports an element to target and it keeps reactivity which is minimal abilities imo. So if anything else, let me know.
Now we can define string templates and teleport with no problems. @KevinBatdorf @HugoDF @SimoTod Any thoughts? |
Beta Was this translation helpful? Give feedback.
If no one is against it, let's keep it teleport.
I think we got it working as expected now. Reactivity works both way even teleported element is not a component. It's still watches changes on initial component and updates itself if any updates.
#46 (reply in thread)
For now it teleports an element t…