triniwiz / nativescript-pager

Apache License 2.0
90 stars 48 forks source link

Delay transition #154

Closed immocalcul closed 4 years ago

immocalcul commented 4 years ago

Hello hello I use your plugin successfully but I notice a problem. I have 5 different tabs containing a lot of html code. And all create a certain lag when changing the first slide then all become fluid.

use nativescript 6.0 whit angular

triniwiz commented 4 years ago

This issue sounds like you are using the static pageritems am I correct ??

immocalcul commented 4 years ago

yes i send my code :+1:

@ViewChild('pager', { static: true }) pager: any; // tslint:disable-next-line:semicolon public templateSelector = (item: any, index: number) => { switch (item.key) { case 'pret': { return 'pret' } break; case 'frais': { return 'frais' } break; case 'mois': { return 'mois' } break; case 'vente': { return 'vente' } break; case 'profit': { return 'profit' } default: return 'pret' break; } }

and html:

<Pager row="0" [items]="items" disableSwipe="true" [itemTemplateSelector]="templateSelector" #pager [selectedIndex]="currentPagerIndex" (selectedIndexChange)="onIndexChanged($event)" class="pager"> ....

immocalcul commented 4 years ago

Ce problème semble indiquer que vous utilisez les pageritems statiques, ai-je raison ??

moreover I can not use routing in multi template because it is data to calculate in all tabs. I do not understand for a normal slide with tabs I'm not lag but with the plugin too. One solution would be well appreciated to avoid this problem in static

triniwiz commented 4 years ago

You are not using the static pager that's the viewchild you are referring to

triniwiz commented 4 years ago

try using the static pager items