Skip to content
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

ionic4 compatibility #366

Closed
kirillgroshkov opened this issue Mar 4, 2019 · 63 comments
Closed

ionic4 compatibility #366

kirillgroshkov opened this issue Mar 4, 2019 · 63 comments
Assignees

Comments

@kirillgroshkov
Copy link

kirillgroshkov commented Mar 4, 2019

I searched and couldn't find an issue about that.

I've seen that master branch is a WIP to achieve that. So, I guess I'll just leave this issue here to track the progress (unless I'm missing something).

ps: if there's something that we (community) can help with (something small and separate) - please tell!

Otherwise, we're kind of blocked to upgrade to Ionic4 unless this package is updated.

@anuj9196
Copy link

anuj9196 commented Mar 6, 2019

Also waiting for ionic4 support.

@Pingolus
Copy link

Pingolus commented Mar 8, 2019

Yea super-tabs are just 10x better than default ionic tabs ! Hope one day this plugin will be part of ionic core widgets ? Just waiting for it I migrated to ionic 4 and now I'm using defaults tabs : hope to change it quickly to super tabs because it rocks ! Thank's for this plugin because It's a big lack on ionic !

@pipoa
Copy link

pipoa commented Mar 9, 2019

@ihadeed
I really appreciate your hard work for ionic2-super-tabs.
After tried ionic2-super-tabs v5.2.0 in Ionic v4, I got errors below:
Module not found: Error: Can't resolve 'ionic-angular' in xxxxxx/node_modules/ionic2-super-tabs

Wish you can help on this soon when your are free.
Many thanks ^_^.

@anuj9196
Copy link

anuj9196 commented Mar 9, 2019

@pipoa This issue is due to version incompatibility of ionic and the way ionic is imported in ionic3 and ionic4.

Wait for Ionoc4 support.

@ihadeed ihadeed pinned this issue Mar 9, 2019
@ihadeed ihadeed self-assigned this Mar 22, 2019
@Pingolus
Copy link

Thank's a lot @ihadeed
If you need some help (for testing purposes per example), don't hesitate to ask us.

@ihadeed
Copy link
Member

ihadeed commented Mar 23, 2019

@Pingolus thank you!

The new version is almost ready for beta testing, I will make sure to post an update here when I have a shipped package that can be installed. Expect something over this weekend.

@ihadeed
Copy link
Member

ihadeed commented Mar 24, 2019

Update: most of the major features are implemented. The tabs are functional, swipeable, dyanmic, and have the option for a scrollable toolbar.

https://youtu.be/jZdl1gAWwf0

Will work on compiling a shippable Angular 7 package now.

@ihadeed
Copy link
Member

ihadeed commented Mar 24, 2019

Update:

Just published @ionic-super-tabs/core and @ionic-super-tabs/angular.

There is an issue with the way it exports typings, can't seem to figure out why, so until it's fixed you will need to do this work around (which shouldn't impact your app negatively).

Edit your app's tsconfig.json and add this to the end of it, if your already have an "include" or "files" tag, you can just add this additional file to it.

{
   ...
  "include": [
    "src",
    "node_modules/@ionic-super-tabs/core/dist/types/components.d.ts"
  ]
}

The example project is being updated/rebuilt: https://github.com/zyra/ionic2-super-tabs-example/tree/v7


A quick getting started guide:

# Angular
npm i -S @ionic-super-tabs/angular

# Non angular
npm i -S @ionic-super-tabs/core
// Angular only

// App.module.ts
import { SuperTabsModule } from '@ionic-super-tabs/angular'

@NgModule({ 
 ... 
  imports: [
    ...
    SuperTabsModule.forRoot(),
  ]
})

// your lazy loaded module
@NgModule({
   ...
   imports: [
     ...,
     SuperTabsModule,
   ]
})
<super-tabs>
  <super-tabs-toolbar position="top">
    <super-tab-button>
       <ion-icon name="flame">
       <ion-label>Hello</ion-label>
    </super-tab-button>
    <super-tab-button>
       <ion-icon name="call">
       <ion-label>World</ion-label>
    </super-tab-button>
  </super-tabs-toolbar>
  <super-tabs-container>
    <super-tab>
       Im a custom page
    </super-tab>
    <super-tab>
       <ion-nav root="some page" />
    </super-tab>
  <super-tabs-container>
</super-tabs>

@dennissch
Copy link

Thanks @ihadeed!
I've added Super Tabs in addition to the normal ion-tab. It works as expected :)

screen

I recognized the following:

  • TabChange event is not sent (<super-tabs (tabChange)="onTabChange($event)">). Also tested activeTabChange, activeTabIndexChange and selectedTabIndexChange. All events do not seem to work properly yet.

  • I was not able to layout the super-tab-indicator component, all settings are hidden behind the shadow root (eg. --st-indicator-position-x: 0px; --st-indicator-scale-x: 1.02; --st-indicator-transition-duration: 300ms; background: ...)

  • I could not integrate SuperTabs programmatically.

constructor(
  private supertabs: SuperTabs
) { 
  console.log('activeTabIndex', this.supertabs.activeTabIndex );
}
ChatTabsPage_Host.ngfactory.js? [sm]:1 ERROR Error: StaticInjectorError(AppModule)[ChatTabsPage -> SuperTabs]: 
  StaticInjectorError(Platform: core)[ChatTabsPage -> SuperTabs]: 
    NullInjectorError: No provider for SuperTabs!
    at NullInjector.push../node_modules/@angular/core/fesm5/core.js.NullInjector.get (core.js:8895)

I am looking forward to the next update and thank you for the great work.

@paulovargatt
Copy link

paulovargatt commented Mar 24, 2019

Thanks for the update!
I was unable to retrieve the tabChange event ...

How is navigation to other pages using RouterLink?

What is the best way to enable lazyloading for tabs?

@pipoa
Copy link

pipoa commented Mar 25, 2019

@ihadeed I love you so much and I love super-tabs either.
Thanks for your quickly update and response, I will try it today or tomorrow.
many thanks~

@ihadeed ihadeed added this to the 6.0.0 (Ionic 4 support) milestone Mar 28, 2019
@pipoa
Copy link

pipoa commented Apr 1, 2019

I already have super-tabs worked with tabChange event(detail:.. ) and styling, but with 2 important problems unsolved below:

  1. in the case that super-tab-button(s) are totally wider then super-tabs-toolbar, no overflow scroll available.
  2. don't know how to programmatically set tab selected, is there [(selectedTabIndex)]?

@ihadeed
Copy link
Member

ihadeed commented Apr 2, 2019

@dennissch

  1. Events should be working now
  2. The CSS variables you mentioned are for internal use and not meant for customizations. The docs are now updated (check redme.md files in each component directory) to show all the available CSS variables.
  3. You can get an instance of SuperTabs by using .querySelector() function in vanilla JS, or @ViewChild() decorator in Angular. Examples:
// Vanilla
const superTabs = document.querySelector('super-tabs'); // Instead of document you can use any HTML element, and instead of `super-tabs` you can use another unique selector

// Angular
import { ViewChild } from '@angular/core';
import { SuperTabsComponent } from '@ionic-super-tabs/core';
...

@ViewChild(SuperTabsComponent) superTabs: SuperTabsComponent;






@paulovargatt

  1. Events are updated and documented now.
  2. Deep linking / Angular router support is not available as of now. Not sure if it will be part of this module. Would like to know what use cases you may have though.
  3. There are no lazy loading capabilities yet. Will definitely explore this feature.





@pipoa

  1. You have to set scrollable attribute to true on the toolbar component. See https://github.com/zyra/ionic-super-tabs/tree/master/core/src/super-tabs-toolbar#properties
  2. There is a method for that https://github.com/zyra/ionic-super-tabs/tree/master/core/src/super-tabs#selecttabindex-number-animate-boolean--void

@dennissch
Copy link

thanks @ihadeed, I've tested the newest version (6.0.0-beta.8) and generate production builds for iOS and Android (through Ionic AppFlow). Everything works on an Android device, but on iOS I only see a white area. Does anyone have an idea? In the console, as well as during the build process, no errors were thrown.

IMG_5606

(swipe is not working, but I can click on each tab)

@pipoa
Copy link

pipoa commented Apr 4, 2019

thanks @ihadeed,
I just want to set one specified page active when enter a page.
I cannot make activeTabIndex work, and even cannot identify which tab is current selected tab?
Is there an attribute-way to make tab selected?

@NgYueHong
Copy link

@ihadeed Awesome plugin!!! When will the ionic 4 support ready?

@Pingolus
Copy link

Thank's ! Two remarks :

  • I just run super-tabs-example and routing seems not completed (I imagine it's a known issue)
  • I have somme troubles installing new version on my existing ionic project : 'super-tab-button' is not a known element. I'm looking on that (I already added supertabs to app.module.ts file as the example shows it)

@WHeesters
Copy link

The plugin works great on Android, unfortunately I've got the same problem as @dennissch. On iOS I only see a blank screen.

@maeisdev
Copy link

Great work,
but I have several problems with this.

  • On iOS pages in tabs are not displayed
  • On iOS sliding is working only from left to right, and it always sliding to the first tab
  • On iPhone X should be bigger margin, while tabbar is on the bottom

I will follow the topic and use this repository as it will be relatively stable. But currently only the ionic tabs remain.

@Pingolus
Copy link

Pingolus commented May 6, 2019

Hi,
Any news about ionic 4 compatibility ? Thanks

@stinaa
Copy link
Contributor

stinaa commented May 9, 2019

I submitted a PR with a fix for the blank page issue affecting Safari on all platforms. #379 🤓

@Pingolus
Copy link

Hi,
Can we help you to release ionic 4 support ? Is there a blocked task, anything we can do ?
I kown it's open source & free dev, so I understand it's not a priority. But I hoped it'll be available in April as you wrote 12 April. Is it still in progress ? Don't hesitate asking for help.

@ihadeed
Copy link
Member

ihadeed commented Jun 3, 2019

@Pingolus

The latest version 6.0.0-beta.10 is stable enough, but the iOS performance is poor.

Will need to revise the usage of QueueApi / requestAnimationFrame to figure out what the issues are.

Most of the animations aren't working properly on iOS at the moment; but the module is usable overall and is still somewhat better than the plain framework tabs.

@Pingolus
Copy link

Pingolus commented Jun 14, 2019

Hi @ihadeed , thank's for your reply.

The latest version 6.0.0-beta.10 is stable enough, but the iOS performance is poor.

What do you mean by "poor" ? I'll try beta version ; but I worry about that and about the fact that there're some bug reported.. I'd like to use only stable and tested packages on production. Last time I tried the example project which was no working at all (some weeks ago).

Thanks a lot for your work.

EDIT : I tried beta ; it works like a charm ! =) I just have an issue with ion refresh with iOS ; I'll create another topic for that.

@pipoa
Copy link

pipoa commented Jul 1, 2019

@Pingolus

The latest version 6.0.0-beta.10 is stable enough, but the iOS performance is poor.

Will need to revise the usage of QueueApi / requestAnimationFrame to figure out what the issues are.

Most of the animations aren't working properly on iOS at the moment; but the module is usable overall and is still somewhat better than the plain framework tabs.

Instead 6.0.0-beta.10 I use 6.0.0-beta.9 , because 6.0.0-beta.10 looks a little weird when swipe between tabs.
However, if content in super-tab is longer then just a page, finger swipe becomes very weird and unstable too in 6.0.0-beta.9. Pages float up and down, shaking left and right, and very easy stay in the middle between switch pages.
In the mean while tap tab to swipe is ok, the swipe animation is smooth.

@ezrayeoh
Copy link

@dennissch i notice that if the app is rotated horizontally and back vertically (change sizes), the problem doesn't occur. Is the problem affected by the screen size?

@dennissch
Copy link

@ezrayeoh @ihadeed The issue always occurs when the content height is smaller than the visible area. You have to scroll down a bit first (if there is enough content), then the tabbar stays in the correct position (and does not move down).

@dennissch
Copy link

I also noticed the following: If super-tabs-toolbar has been initialized with the option scrollable="true" and programmatically a tab is selected, the indicator is positioned incorrectly (pressed to the right edge).

...
@ViewChild(SuperTabs, { static: false }) superTabs: SuperTabs;
...
ngAfterViewInit() {
	this.superTabs.selectTab(2);
}
...
<super-tabs [config]="config" (tabChange)="onTabChange($event)">
	<super-tabs-toolbar scrollable="true" scrollablePadding="false">
....

supertabs-issie-indicator

@utbhavesh
Copy link

With

Angular

npm i -S @ionic-super-tabs/angular@^6.0.0-rc.0

I am not able to swipe the super-tabs-container, also I am not able to change content when I click on the super-tab-button in super-tabs-toolbar

@aleygues
Copy link

@utbhavesh I had the same problem, the only way is to build using the --prod flag to make it work correctly.

@dennissch
Copy link

dennissch commented Sep 2, 2019

I am not able to swipe the super-tabs-container, also I am not able to change content when I click on the super-tab-button in super-tabs-toolbar

@ihadeed @utbhavesh After some trying, I was able to narrow down the issue. It seems that SuperTabs are loaded before the document. With the SetTimeout workaround swiping works again.

/node_modules/@ionic-super-tabs/core/dist/esm/super-tab_3.entry.js

...
async componentWillLoad() {

    if (this.config) {
        await this.setConfig(this.config);
    }

    setTimeout(async () => { // XXX

        this.debug('componentWillLoad fired');
        // index children
        this.indexChildren();
        // set the selected tab so the toolbar & container are aligned and in sync
        this.selectTab(this.activeTabIndex);
        // setup event listeners so we can synchronize child components
        // 1. listen to selectedTabIndex changes emitted by the container.
        this.el.addEventListener('selectedTabIndexChange', this.onContainerSelectedTabChange.bind(this));
        // 2. listen to activeTabIndex changes emitted by the container
        this.el.addEventListener('activeTabIndexChange', this.onContainerActiveTabChange.bind(this));
        // 3. listen to tab button clicks emitted by the toolbar
        this.el.addEventListener('buttonClick', this.onToolbarButtonClick.bind(this));

    }, 1000);
}
...

@aditbharadwaj
Copy link

aditbharadwaj commented Oct 10, 2019

I am not able to swipe the super-tabs-container, also I am not able to change content when I click on the super-tab-button in super-tabs-toolbar

@ihadeed @utbhavesh After some trying, I was able to narrow down the issue. It seems that SuperTabs are loaded before the document. With the SetTimeout workaround swiping works again.

/node_modules/@ionic-super-tabs/core/dist/esm/super-tab_3.entry.js

...
async componentWillLoad() {

    if (this.config) {
        await this.setConfig(this.config);
    }

    setTimeout(async () => { // XXX

        this.debug('componentWillLoad fired');
        // index children
        this.indexChildren();
        // set the selected tab so the toolbar & container are aligned and in sync
        this.selectTab(this.activeTabIndex);
        // setup event listeners so we can synchronize child components
        // 1. listen to selectedTabIndex changes emitted by the container.
        this.el.addEventListener('selectedTabIndexChange', this.onContainerSelectedTabChange.bind(this));
        // 2. listen to activeTabIndex changes emitted by the container
        this.el.addEventListener('activeTabIndexChange', this.onContainerActiveTabChange.bind(this));
        // 3. listen to tab button clicks emitted by the toolbar
        this.el.addEventListener('buttonClick', this.onToolbarButtonClick.bind(this));

    }, 1000);
}
...

yep the settimeout on this solved the issue , i was not able to switch tabs through gestures or click when i restart the app as the toolbar loads before. now it works again on reloading the app or re-logging ( in my app scenario)

@ihadeed
Copy link
Member

ihadeed commented Oct 10, 2019 via email

@kunalkakkad
Copy link

Hello,
Can anyone guide me on how to place super tabs in the bottom of the screen?
As it is not accepting any properties like "tabsPlacement=bottom".
I am checking it on Ionic v4.

Thanks.

@aditbharadwaj
Copy link

aditbharadwaj commented Oct 18, 2019

Hello,
Can anyone guide me on how to place super tabs in the bottom of the screen?
As it is not accepting any properties like "tabsPlacement=bottom".
I am checking it on Ionic v4.

Thanks.

just add

slot="bottom"

<super-tabs-toolbar slot="bottom" >
it works for me , it should for u as well

@kunalkakkad
Copy link

Hello,
Can anyone guide me on how to place super tabs in the bottom of the screen?
As it is not accepting any properties like "tabsPlacement=bottom".
I am checking it on Ionic v4.
Thanks.

just add

slot="bottom"

<super-tabs-toolbar slot="bottom" >
it works for me , it should for u as well

Thanks man.
It worked.

@aditbharadwaj
Copy link

aditbharadwaj commented Oct 19, 2019 via email

@danielehrhardt
Copy link

danielehrhardt commented Oct 19, 2019

Are there any sample Styles for the current Super Tabs.

Ah i had to import the forRoot Module

SuperTabsModule.forRoot()
--> in the app.module.ts

@JuniorFlorentino
Copy link

good afternoon, how to call to pages like son of a super tab, I did not want it to be on the same screen, another difficulty I am trying is to enable scrolling in super tab content, when there is too much content

@aditbharadwaj
Copy link

good afternoon, how to call to pages like son of a super tab, I did not want it to be on the same screen, another difficulty I am trying is to enable scrolling in super tab content, when there is too much content

i can answer one part of that question. u can use modalControllers to call child pages from super tabs they will cover the tabs as well when called and u can style them accordingly. ( if iam guessing ur question right)

@JuniorFlorentino
Copy link

@aditbharadwaj Is there a possibility to call a super tab like a normal tab?

@JuniorFlorentino
Copy link

because with a ModalController it will be awkward when dragging the tab it covers, I wanted it to open underneath like a normal tab

@aditbharadwaj
Copy link

aditbharadwaj commented Nov 8, 2019

@aditbharadwaj Is there a possibility to call a super tab like a normal tab?

are u referring to this type of example ? on issue #396

@ihadeed
Copy link
Member

ihadeed commented Nov 8, 2019

@JuniorFlorentino

how to call to pages like son of a super tab

To call methods on a child page from the root page containing your <super-tabs> element, you can do one of the following:

  • use a service
  • use ngrx
  • inject the root page in the child page

Quick example for the third option:

// in root.page.ts
export class RootPage {

private childPage: ChildPage;

registerChildPage(page: ChildPage) {
  this.childPage = page;
}

onSomethingClick() {
  this.childPage.doSomething();
}

// in child.page.ts
export class ChildPage { 
constructor(parent: RootPage) {
  parent.registerChildPage(this);
}

doSomething() {
  console.log('Root page asked me to do something');
}

The third option will cause a circular dependency. Not sure what side effects that may have but from a quick test it seemed to be fine.

I am trying is to enable scrolling in super tab content, when there is too much content

Are you referring to the toolbar buttons?
Those can be made scroll-able by setting the scrollable property on <super-tabs-toolbar>:

...
<super-tabs-toolbar [scrollable]="true">
...

@JuniorFlorentino
Copy link

when I have a lot of text I can't scroll down, even using the = [scrollable]="true"
Capturar

@JuniorFlorentino
Copy link

my code:

Informationen Bilder Video Botschaft
<super-tabs-container >
  <super-tab>
    What is Lorem Ipsum?
    Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's
    standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make
    a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting,
    remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing
    Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions
    of Lorem Ipsum.

    Why do we use it?
    It is a long established fact that a reader will be distracted by the readable content of a page when looking at
    its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as
    opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing
    packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum'
    will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by
    accident, sometimes on purpose (injected humour and the like).


    Where does it come from?
    Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin
    literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney
    College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and
    going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum
    comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by
    Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance.
    The first line of Lorem Ipsum, "Lorem

    Where does it come from?
    Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin
    literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney
    College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and
    going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum
    comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by
    Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance.
    The first line of Lorem Ipsum, "Lorem

    Where does it come from?
    Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin
    literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney
    College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and
    going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum
    comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by
    Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance.
    The first line of Lorem Ipsum, "Lorem

    Where does it come from?
    Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin
    literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney
    College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and
    going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum
    comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by
    Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance.
    The first line of Lorem Ipsum, "Lorem
  </super-tab>
  <super-tab>
    
  </super-tab>
  <super-tab>
    
  </super-tab>
</super-tabs-container>

@ihadeed
Copy link
Member

ihadeed commented Nov 12, 2019

@JuniorFlorentino

You need to place your content inside of <ion-content></ion-content> if it's not an <ion-nav>

@JuniorFlorentino
Copy link

@ihadeed Thanks so much, it really worked, thank you so much for your time.

@JuniorFlorentino
Copy link

@ihadeed Are there any events other than tabChange?

@JuniorFlorentino
Copy link

because whenever I scroll the page, it happens to run the TabChange event, I would like it to run only when the page actually changes

@JuniorFlorentino
Copy link

[Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for example because scrolling is in progress and cannot be interrupted.

@ihadeed
Copy link
Member

ihadeed commented Nov 12, 2019

Closing this issue since the Ionic 4 compatibility is now released.

@JuniorFlorentino please open another issue with any issues/questions you have so we're not spamming all the subscribers here. Thanks.

@ihadeed ihadeed closed this as completed Nov 12, 2019
@zyra zyra locked as resolved and limited conversation to collaborators Nov 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests