question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

iOS Tabs component issue when changing selectedIndex by tapping the desired Tab + TabContent is RadListView

See original GitHub issue

Environment 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). ios_tabs_issue_selectedindex

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. ios_tabs_snapping_fanfiktion

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). ios_tabs_correct_listview

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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
felixkrautschukcommented, Jun 4, 2020

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:

NativeScript encountered a fatal error: Error: Invalid parameter not satisfying: [views count] == 3

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…

1reaction
AnthonyLengletcommented, Apr 27, 2020

Did you also use RadListViews as your TabContents ?

We used router outlets inside stacklayouts on our end !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nativescript Tabs not working when parent has tap event
The issue here is not hiding keyboard but just the tap event on the parent. You could still try adding listeners on each...
Read more >
Tabs - NativeScript Docs
The NativeScript's Tabs component provides a simple way to navigate between different views while providing common UI for both iOS and Android platforms....
Read more >
Multiple issues in SfTabView | Xamarin.Forms Forums
- I have 3 tabs and I'm with the first tab open. - I use the code SfTabView.SelectedIndex = 1 (to select the...
Read more >
Tabs - Lightning Design System
Use these tabs when users need to work across multiple sub-pages within a single navigation item.
Read more >
Diff - b66d8ae9dc..4434137b67 - chromium/src - Git at Google
diff --git a/DEPS b/DEPS index 0d46dea..ee2d5a1 100644 --- a/DEPS +++ b/DEPS @@ -40,11 +40,11 @@ # Three lines of non-changing comments so that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found