ProgressNS / nativescript-ui-feedback

This repository is used for customer feedback regarding Telerik UI for NativeScript. The issues system here is used by customers who want to submit their feature requests or vote for existing ones.
Other
115 stars 21 forks source link

[RadListView] Changing Label text does not update it's Layout #1379

Open jerbob92 opened 4 years ago

jerbob92 commented 4 years ago

We use NativeScript Angular together with RadListView. We have some labels that use a Directive to set the text of the Label, like this:

<Label RelatedObjectLabel [relatedObjectID]="item.RelatedObjectID"></Label>

The Directive loads the object from the database that has the id RelatedObjectID (this happens in a Promise), when the loading is done, it sets the title of the RelatedObject as text in the Label, like this (el is ElementRef in Angular, a reference to the Label element):

this.el.nativeElement.text = relatedObject.label;

The text actually gets changed, but the size of the Label view does not change, it's always the size of the first value. Setting the text outside an Promise works fine.

The Label is in a GridLayout, but it's not a specific problem to GridLayout, it also seems to happen in other Layouts. The GridLayout looks like:

<GridLayout columns="auto, *, auto" rows="30">

</GridLayout>

The Label is in the third column, so when the label get's longer, the idea is that column 3 gets larger, and column 2 gets smaller.

We tested the following things:

Here is a video to show the bug: https://www.dropbox.com/s/lx90zmu35rn102t/recording.mp4?dl=0

Which platform(s) does your issue occur on?

iOS, android works fine.

Please provide the following version numbers that your issue occurs with:

Please tell us how to recreate the issue in as much detail as possible.

See description. And see below for example app.

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

Example app that demonstrates the bug: https://github.com/jerbob92/radlistview-label-bug

I added 2 tabs, to compare between RadListView and normal ListView. You can see in the RandomLabelDirective that it generates a random string every time the input changes. This causes the labels to be longer/shorter when you scroll up and down, which makes it easy to see that it's not working correctly.