Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(runtime): set text attribute to NS views when the last element i…
…s a text node
- Loading branch information
8c8b4aa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm - I've had this in there before, but then refactored how the text is set when there are text child nodes:
nativescript-vue-next/packages/runtime/src/nodes.ts
Lines 265 to 274 in 8c8b4aa
Have you run into a case where this was needed?
Very possible that I may be missing something, so just checking! :)
8c8b4aa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rigor789 if we don't declare the
text
getter and setter, it fails setting thetext
attribute in the NS nativeView when there are several root nodes in the Vue instance:As you know, allowing several root nodes is a new "feature" in Vue 3. BTW, I don't know why it works in the other cases and for this case doesn't, maybe even it's a Vue issue. You can check it out by commenting on the setter and getter and run
yarn test
8c8b4aa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@msaelices ah seems like
h('Label', 'sometext')
has a short path - and the text isn't actually added as a TextNode, but it's directly set as thetext
on the ElementNode (I assume this would be then set totextContent
on web)Looks good! 👍