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

How to place super-tabs inside ion-toolbar #455

Open
svzi opened this issue Sep 30, 2020 · 2 comments
Open

How to place super-tabs inside ion-toolbar #455

svzi opened this issue Sep 30, 2020 · 2 comments

Comments

@svzi
Copy link

svzi commented Sep 30, 2020

Describe the bug
When I place the ionic-super-tabs inside an ion-toolbar the super-tabs don't show.

To Reproduce

<ion-header [translucent]="true">
  <ion-toolbar>
    <ion-buttons slot="start">
      <super-tabs active-tab-index="1">
        <super-tabs-toolbar slot="top" scrollable="false" scrollable-padding="false">
          <super-tab-button>
            <ion-label>Tab 1</ion-label>    
          </super-tab-button>
          <super-tab-button>
            <ion-label>Tab 2</ion-label>    
          </super-tab-button>
          <super-tab-button>
            <ion-label>Tab 3</ion-label>    
          </super-tab-button>
        </super-tabs-toolbar>  
        <super-tabs-container>
           <super-tab>
            <ion-nav [root]="tab1"></ion-nav>
          </super-tab>
          <super-tab>
            <ion-nav [root]="tab2"></ion-nav>
          </super-tab>
          <super-tab>
            <ion-nav [root]="tab3"></ion-nav>
          </super-tab>
        </super-tabs-container>
      </super-tabs>
    </ion-buttons>

    <ion-buttons slot="end">
			<ion-button>
				<img slot="icon-only" src="/assets/imgs/icon.svg" alt="bla" />
			</ion-button>
		</ion-buttons>
  </ion-toolbar>
</ion-header>

Expected behavior
I need to add a button on the right side of the super-tabs, so I hoped I could use it like an ion-segment in the ion-toolbar.

Is there anything I could do about? Any help would be really much appreciated.

Best,
Sven

@ihadeed
Copy link
Member

ihadeed commented Oct 1, 2020

You could probably use a flex container instead of the toolbar buttons

<super-tabs>
  <div style="display: flex; flex-flow: row nowrap;" slot="top">
     <super-tabs-toolbar>...</super-tabs-toolbar>
     <ion-buttons> ... </ion-buttons>
  </div
...

but that will most likely break some of the animation / gesture logic that assumes toolbar and container both share the same width

@svzi
Copy link
Author

svzi commented Oct 1, 2020

@ihadeed Great idea, thanks! But sadly I can't get it to work this way. The super-bar renders as undefined in the html view. I tried to move the flex-container around, and move the super-tabs-container from inside to outside the div, but nothing worked.

Thanks again for your help, even if it didn't work out as hoped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants