Skip to content

Empty label on ios #272

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

Closed
mathieutu opened this issue Jul 1, 2018 · 6 comments
Closed

Empty label on ios #272

mathieutu opened this issue Jul 1, 2018 · 6 comments

Comments

@mathieutu
Copy link

Version

1.3.1

Reproduction link

https://play.nativescript.org/?template=play-vue&id=3SaUXi&v=3

Platform and OS info

Nativescript from vue-cli-template, Ios in emulator.

Steps to reproduce

HI,
Inside a ListView, I have a another component which contains a Label.

<Label :text="user.name" class="list-group-item-heading" :textWrap="false" style="height: 100%"/>

It works perfectly on android but not on ios.
on Ios the label is empty.

BUT if I convert the name to a string (which is already) directly in the template, it works!

<Label :text="String(user.name)" />
<Label :text="user.name + ''" />

If I do the same in a computed property it doesn't work, it has to be in the template.

I precise that in the chrome debugger I can see that the xml is ok, the name appear well in sources, but not in the application.

What is expected?

Label should not be empty on ios

What is actually happening?

Label is empty on ios


I'm not sure that the reproduction link actually reproduce the problem as I don't have an iPhone to test it, the problem occur in the emulator.

@mathieutu
Copy link
Author

Ok, I think I've understood where is the problem.
The items passed to the listView are an array of User objects:

export default class User {
    constructor(user) {
        this.name = user.profile.real_name_normalized.toUpperCase();
    }
};

And the item passed throw the template is not of type User anymore. Maybe something happen at this time ?

@rigor789
Copy link
Member

Please try 2.0.0-alpha.1 as we changed how ListViews are rendered. It should solve the issue, but please let me know, I'll keep the issue open until then.

@mathieutu
Copy link
Author

ok, I'm not on it right now, but I'll try and let you know.
Thank's for all your amazing work @rigor789! 😉

@msaelices msaelices added the next label Jul 31, 2018
msaelices added a commit that referenced this issue Jul 31, 2018
@msaelices
Copy link

@mathieutu I've added a test case and confirmed that it's working on the 2.0.0-alpha.1 version

CC/ @rigor789

@msaelices
Copy link

Closing this issue as it works on the 2.0.0-alpha.1 version. Please re-open it if I missed something.

@nativescript-vue-bot
Copy link
Collaborator

We are locking this issue because it has been closed for more than 14 days.

If the issue comes up again please open a new issue with additional details.

@nativescript-vue nativescript-vue locked as resolved and limited conversation to collaborators Aug 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

4 participants