-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Supporting querySelector
#18
Comments
For the record, we could base our code in this nativescript-dom unsupported plugin (see the logic in the dom.js file) @rigor789 IMHO, I would consider this as a nice to have feature, as I don't find it as important to find some DOM node in a mobile app compared with a SPA application or Vue instance embedded in a full HTML page. So, if we are looking into the motivation for Teleport, the main reason is to be able to add dynamic behavior outside the DOM tree managed by the root Vue instance (typically the But this is not the case in NativeScript apps. All the template is always under the Vue control and there is NO markup outside it. In that sense, I would usually implement core features first and would take this kind of features after making sure the framework is solid enough What do you think? |
I think And sure - this is a nice-to-have, and not a blocker. We can visit this anytime in the future! |
I was not proposing including I'm still not sure of the use of |
Right - I got it the first time! Just thought that the implementation of nativescript-dom is more than we'd need for this to work. A simple An example for where Teleports could be useful. Let's say we have this component somewhere nested in a <template>
<StackLayout>
<FormElements...>
<CustomModalThing v-if="showCustomModal">
<SomeStuffForModal :somePropWeBindFromHere="someProp" />
</CustomModalThing>
</StackLayout>
</template> We can now render <template>
<GridLayout>
<Frame />
<GridLayout id="teleportTarget"/> <!-- CustomModalThing would get rendered here -->
</GridLayout>
</template> |
@rigor789 got it! Thanks for your explanation. |
Figure out if we can support
querySelector
innodeOps
. It is used by internal components like Teleport (was Portal) - which would be nice if we could support them.Seems like we can pass element's to the target as well, but from a DX perspective, it's easier to pass an element id.
Trouble is, NativeScript has the
getViewById
method on it's Views, but it's scoped to the views children as far as I know - how can we find an element globally?NSVElement
class?#someid
) (not sure if the hashtag is required/passed)...The text was updated successfully, but these errors were encountered: