Description
What problem does this feature solve?
One of the main features of Vue is to control, what components are displayed.
Teleport however requires that an element is mounted before the teleport tag is mounted.
If for some reason the teleport target is removed but mounted again, the teleport does not work.
What I want is:
If teleport is enabled (:disable="false"), then look for the element to be teleported to.
return error or warning if not found.
teleport if found.
This feature would make teleport a lot more easy to use, because it fits better into an Vue environment where everything is reactive.
As for a use-case:
I currently want to teleport an input-field to a sidebar (https://www.primefaces.org/primevue/sidebar) that is displayed on small displays. The sidebar is displayed when I click on the inputfield. Even if I make sure that the teleport is enabled after (up to 10sec) the sidebar is displayed, the teleport fails silently.
What does the proposed API look like?
If teleport is enabled (:disable="false"), then look for the element to be teleported to.
return error or warning if not found.
teleport if found.