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.

bug: certain tab methods missing on framework integrations

See original GitHub issue

Bug Report

Ionic version:

[x] 4.11.5

Current behavior: this.tabs.getTab is not a function

Expected behavior: getTab should return tab component

Steps to reproduce: on page with tabs: @ViewChild(IonTabs, { static: false }) tabs: IonTabs; And run this code:

const currentTab = this.tabs.getSelected();
console.log(this.tabs.getTab(currentTab));

This gives error: ERROR TypeError: "this.tabs.getTab is not a function" In console: error TS2339: Property 'getTab' does not exist on type 'IonTabs'.

According to docs: https://ionicframework.com/docs/api/tabs :

getTab
--
Get a specific tab by the value of its tab property or an element reference.
getTab(tab: string \| HTMLIonTabElement) => Promise<HTMLIonTabElement \| undefined>

Related code:

const currentTab = this.tabs.getSelected();
console.log(this.tabs.getTab(currentTab));

Other information:

Ionic info:

Ionic:

   Ionic CLI                     : 5.4.2
   Ionic Framework               : @ionic/angular 4.11.5
   @angular-devkit/build-angular : 0.803.8
   @angular-devkit/schematics    : 8.3.8
   @angular/cli                  : 8.3.19
   @ionic/angular-toolkit        : 2.0.0

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : ios 5.0.1
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.0, (and 8 other plugins)

Utility:

   cordova-res : not installed
   native-run  : not installed

System:

   Android SDK Tools : 26.1.1 
   NodeJS            : v12.13.0 
   npm               : 6.12.0
   OS                : Linux 4.15

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:16 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
sjregancommented, Jan 24, 2020

My use case for the getTab function is to try and attach data to a tab element, then read that data within the ionTabsWillChange event.

It would be super useful to have the online documentation state which frameworks functions and attributes are present/used in, I waste a lot of time trying to do things that turn out to be impossible due to methods and attributes being specific to certain frameworks but no indicators within the documentation.

2reactions
michaelsogoscommented, Feb 25, 2021

Dear all,

I can confirm that the issue still exists also for v5.5.4 with VueJS.

I can get the value with property “selectedTab” (not documented) but method “getSelected()” fail with error “is not a function”. Same for “select()”.

Do you have any plan to resolve this? Seems that VUEJS integration is too buggy for production.

Read more comments on GitHub >

github_iconTop Results From Across the Web

bug: certain tab methods missing on framework integrations ...
In my case, I need to access a tab to change its label when the user changes a value in a page form....
Read more >
Addressing missing framework crashes - Apple Developer
Identify missing frameworks from a crash report, and adjust your app's build to correctly include the framework.
Read more >
How to use tabs getSelected method in ionic 5 vue app
I would like to know how to use the getSelected() method in tabs. ... bug: certain tab methods missing on framework integrations.
Read more >
Bug #1772680 “RBdigital integration” : Bugs : Evergreen
The RBdigital search results will appear in the OPAC on a different tab - a search in basic or advanced Evergreen search will...
Read more >
iOS integration guide - Platforms - Bugsnag docs
Under the General tab, click the Frameworks, Libraries and Embedded Content section's + button and select Bugsnag.framework (from 'Bugsnag-iOS').
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