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

Ng Directives doesnt work within radlistview #1226

Closed cherimo closed 5 years ago

cherimo commented 5 years ago

Tell us about the problem

I am using ngSwitch to show some specific status label, but when I swipe the item and tapping the item to change the status, the current status label hides but the correct label doesn't show up. When I scroll off screen and right back the correct label appears.

Which platform(s) does your issue occur on?

Only iOS (Android tested, works fine)

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

I am using the latest version of Nativescript and Radlistview

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

This is my HTML code:

..Radlistview..

<StackLayout [ngSwitch]="item.status" verticalAlignment="center"  col="0">
  <Label *ngSwitchCase="2" style="color:red;" text="&#xf191;" class="icon"></Label> 
  <Label *ngSwitchCase="1" style="color:green;" text="&#xf17b;" class="icon"></Label>
  <Label *ngSwitchCase="3" style="color:orange;" text="&#xf376;" class="icon"></Label>
  <Label *ngSwitchCase="4" style="color:black;" text="&#xf14c;" class="icon"></Label>
  </StackLayout>

../Radlistview..

Is there a way to force re-rendering again for the item? Without having to scroll down and up again?

Thank you

tsonevn commented 5 years ago

HI @cherimo I reviewed your case and was able to recreate the issue for both Android and iOS. I am attaching a sample project that I used for testing as a reference. On that matter, I will mark this as a bug and we will investigate it further. Currently, I was unable to find a solution that can workaround the problem.

tsonevn commented 5 years ago

HI @cherimo, We reviewed again the issue and the ngSwitchCase seems to work as expected in RadListView. Perhaps, the issue is connected to binding the wrong object to the ngSwitch. I've made the same mistake in my sample project and when I replace [ngSwitch]="item.status" with [ngSwitch]="country.status", the directive start to work properly. As a reference, I am attaching the sample project with the edit.