iOS Tabs component issue when changing selectedIndex by tapping the desired Tab + TabContent is RadListView
See original GitHub issueEnvironment
Provide version numbers for the following components (information can be retrieved by running tns info
in your project folder or by inspecting the package.json
of the project):
- CLI: 6.5.0
- Cross-platform modules: 6.51
- Android Runtime: 6.5.0
- iOS Runtime: 6.5.0
- Plugin(s): nativescript-ui-listview 8.1.2 (also tested 7.1.0)
Describe the bug When changing the Tab selectedIndex bei tapping on the desired Tab within the TabStrip, the component is not always snapping to the right content (sometimes only 95% of the desired tab-content visible).
In this case, you have to swipe the content a little bit and tap again, then it works. The following GIF shows our real app, where you can see this effect easier than in the sample app.
Note: it is only reproducable to us, when using RadlistViews within the Tabs content. We can not reproduce it ourselves when using ListVews instead (but we need RadListView in our real app).
When swiping through the Tabs (without tapping the TabStripItem), everything seems to work as expected on iOS (even if the Tabs contain RadListViews).
To Reproduce 1.) Open the sample app 2.) navigate to the RadListView page 3.) Tap on a TabStripItem -> the content is changing correctly 4.) Tap on another TabStripItem -> nothing happens
Expected behavior Tabs component should behave correctly when tapping the TabStripItems.
Sample project ns-tabs-issues.zip
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:10 (5 by maintainers)
Top GitHub Comments
I just noticed that this issue can be fixed by disabling animations in the following lines of the ios tabs component:
When setting the animated flag for those method calls to “false”, the issue does not appear on my side in both cases, when the tabsPosition is set to top and when it is set to bottom.
In addition, we notice an annoying crash when tapping the Tabs and swiping through the Tabs randomly. The error message was:
And this crash also can be prevented when disabling the animations as described above.
I made a little research and came to this comment on StackOverflow: https://stackoverflow.com/a/48955006
This made me trying to disable the animations temporary in the tns-core-modules and this way I can prevent the issue described in the beginning of this thread and also the crash.
Maybe we can introduce another property
isIOSAnimationEnabled
? It seems to be the only way making the Tabs component and the RadListView working together on iOS…We used router outlets inside stacklayouts on our end !