-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
iOS issues with Pager 11 when assigning the DataSource asynchronous #151
Comments
I have this same issue. Can we get some suggestions on how to avoid this error? |
@felixkrautschuk @trevormackay
and if the source is async you might do something like that. Instead of initializing the source with an empty array, you'll initialize it with null and then you'll wait for the response from the server and then initialize the source with how many items you have.
|
To get proper async I would suggest using an ObservableArray it’s better supported |
try upgrading to the latest version while using the |
try upgrading to the latest version while using the |
@triniwiz first, thank you for relasing another upgrade on this plugin. But unfortunately, the app still crashes on iOS 12 device.
On iOS 13, the crash does not occur. I also cannot see the effect anymore, where all the content was shifted up on the first page. It should actually be centered horizontally all the time (as it is when going forwards). I updated the sample app, so it uses now NS 6.3.2 and nativescript-pager 12.0.0-alpha.0: |
@felixkrautschuk thanks for this usage case and demo so it's fixed 242a359 also I tweaked the demo a bit, I'm saving the selectedIndex to load when with the timeout init method |
@triniwiz thanks, the latest version (12.0.0-alpha.3) fixes the crash on iOS 12. Do you have any idea about the upper part ( < Page x of y > ) moved to the left part of the screen? It orccurs on iOS 12 and 13 and it happens randomly, mostly when going backwards. |
@triniwiz very strange that this effect does not occur on your side. Are you using the native iOS Simulator from Xcode? Because on my side, the latest version of the demo app looks like this: |
I'll try on other sim versions |
@triniwiz I found a solution for the upper part being shifted to the left side.. just by tweaking the outer GridLayout a bit. Thanks for your help on this issue |
In our scenario, we do an initial server request first to obtain the number of pages that we want to show in the pager component then, so at the beginning the pagers' datasource is an empty array and after the request we modify the pages array according to the server response.
This works perfectly on Android across different OS versions, but we have some issues on iOS side.
1.)
On iOS 12 and below, the app crashes as soon as the server request is done and the new pages-array is assigned to the pager component with the following log:
Note, that this crash does not occur when removing the setTimeout-call around the assignment of the datasource (to simulate the server-request... see the sample app provided below for more details).
On iOS 13, the crash does not occur at all.
2.)
When the first page is visible, the layout of the page is not correct (everything is shiftes up... see the GIF for better understanding what I mean.)
In addition, when scrolling forwards and then backwards, you can see that the upper part is suddenly moved to the left. This part is just a normal GridLayout that is centered horizontally and it should work just the way it does when using it outside the pager component.
Alss this issue does not occur on Android at all.
Which platform(s) does your issue occur on?
tested on iOS Simulator iPhone 11 Pro with iOS 13, physical device iPhone 6 with iOS 12.4.3
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.
Describe the steps to reproduce it.
Just open the sample app provided below and navigate to the page that contains the pager component.
Is there any code involved?
NSPagerIssueIOS.zip
The text was updated successfully, but these errors were encountered: