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

[4.0.0-beta.17] ion-segment-button edges out when button number > 4 #16732

Closed
jing-zhou opened this issue Dec 14, 2018 · 6 comments
Closed

[4.0.0-beta.17] ion-segment-button edges out when button number > 4 #16732

jing-zhou opened this issue Dec 14, 2018 · 6 comments
Labels

Comments

@jing-zhou
Copy link

jing-zhou commented Dec 14, 2018

Bug Report

Ionic version:

[x] 4.x

Current behavior:

ion-segment-buttons edges out on both side of tool bar when you have more than 4 ion-segment-buttons. this dose not happen on 4.0.0-beta15
Expected behavior:

all the ion-segment-buttons should be displayed in the toolbar
Steps to reproduce:

initiate an Ionic project with the starter

ionic start myApp tabs --type=angular

copy paste the following code snippts under ion-header sector of the home page
Related code:

<ion-toolbar>
    <ion-segment [(ngModel)]="order" color="light">
      <ion-segment-button value="receive" >
        <ion-label>Receive</ion-label>
      </ion-segment-button>
      <ion-segment-button value="publish" >
        <ion-label>Publish</ion-label>
      </ion-segment-button>
      <ion-segment-button value="topic" >
        <ion-label>Topic</ion-label>
      </ion-segment-button>
      <ion-segment-button value="query" >
        <ion-label>Query</ion-label>
      </ion-segment-button>
      <ion-segment-button value="read" >
        <ion-label>Read</ion-label>
      </ion-segment-button>
      <ion-segment-button value="trash" >
        <ion-label>Trash</ion-label>
      </ion-segment-button>
    </ion-segment>
</ion-toolbar>

Other information:

Ionic info:

Ionic:

   ionic (Ionic CLI)             : 4.3.1 (/home/wjz/.nvm/versions/node/v10.7.0/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.0.0-beta.17
   @angular-devkit/build-angular : 0.10.7
   @angular-devkit/schematics    : 7.0.7
   @angular/cli                  : 7.0.7
   @ionic/angular-toolkit        : 1.2.0

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.0.0
   Cordova Plugins       : cordova-plugin-ionic-webview 2.0.2, (and 13 other plugins)

System:

   Android SDK Tools : 26.1.1 (/home/wjz/Android/Sdk)
   NodeJS            : v10.7.0 (/home/wjz/.nvm/versions/node/v10.7.0/bin/node)
   npm               : 6.2.0
   OS                : Linux 4.15

Environment:

   HTTP_PROXY  : http://127.0.0.1:37245/
   http_proxy  : http://127.0.0.1:37245/
   HTTPS_PROXY : http://127.0.0.1:37245/
   https_proxy : http://127.0.0.1:37245/

@ionitron-bot ionitron-bot bot added the triage label Dec 14, 2018
@manucorporat
Copy link
Contributor

would you mind sharing a screenshot?

@manucorporat manucorporat added the needs: reply the issue needs a response from the user label Dec 14, 2018
@ionitron-bot ionitron-bot bot removed the triage label Dec 14, 2018
@jing-zhou
Copy link
Author

screenshot from 2018-12-14 14-35-48

this is a chrome screen shot while using 'Ionic DevApp'. you can see that the last 'ion-segment-button' (TRASH) had actually been selected, yet it could not been displayed properly

@ionitron-bot ionitron-bot bot added triage and removed needs: reply the issue needs a response from the user labels Dec 14, 2018
@jing-zhou
Copy link
Author

screenshot_20181214_145845

this is the screen shot of the same page from v4.0.0-beta15.

@jing-zhou jing-zhou reopened this Dec 14, 2018
@brandyscarney
Copy link
Member

Segment has been updated to match the Material Design spec. If you have so many buttons that it overflows, we recommend using the scrollable property on ion-segment. You can also customize your segment to use smaller width buttons and less padding, but I don't think it is possible for us to fix this in Ionic for your specific use case. Here's some more information on the Material Design Tabs, which our segment is designed to match: https://material.io/design/components/tabs.html#spec

And here is a codepen where I am editing the segment using CSS to make it fit more and achieve your specific use case: https://codepen.io/brandyscarney/pen/pqyPJB?editors=1100

@jing-zhou
Copy link
Author

Thanks, the CSS works fine for me

@ionitron-bot
Copy link

ionitron-bot bot commented Jan 14, 2019

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Jan 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants