nativescript-rtl / ui

Add right-to-left support to the NativeScript framework
MIT License
24 stars 3 forks source link

Text reversed when the RGridLayout in the ListView template with condition on the row #23

Open boris01 opened 3 years ago

boris01 commented 3 years ago

Mr. Yaslem,, I have a text reversed issue with RGridLayout in the ListView template with condition on the row and more items than screen can show (you need to scroll). Sometimes you can see reversed text right away, and sometimes after you scroll up and down several times. The row with the condition can reverse text, the row without a condition works good. This happens on NS7 angular 11 and NS8 angular 12 with @nativescript-rtl/ui 0.2.0

<GridLayout>
  <ListView [items]="items">
    <ng-template let-item="item" let-i="index">
      <RGridLayout isRtl="true" rows="auto,auto" columns="*,*"  
        [nsRouterLink]="['../item', item.id]">
        <Label *ngIf="i % 2 === 0" row="0" col="0" [text]="item.name"></Label> <!-- Text reversed sometimes -->
        <Label row="1" col="1" [text]="item.name"></Label> <!-- Text good -->
      </RGridLayout>
    </ng-template>
  </ListView>
</GridLayout>

Steps to Reproduce

  1. ns create projectName --ng
  2. ns plugin add @nativescript-rtl/ui
  3. add registration of the RGridLayout in the app.module
  4. Change the ListView template to the code from above in the file item.component.html
  5. Add more items to the array in the file item.service
  6. Run the app and scroll up and down

Result

Screen Shot 2021-06-24 at 10 06 34

Source code for this example rtlError.zip

Thanks for the great plugin!

xlmnxp commented 3 years ago

it happen when the component not in render area?

boris01 commented 3 years ago

Usually yes, But I think that at least once it also happened right on the start

xlmnxp commented 3 years ago

Usually yes, But I think that at least once it also happened right on the start

I will work to fix it

boris01 commented 3 years ago

Thanks

adel12790 commented 2 years ago

Same issue with me.