You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: segment button does not truncate long text correctly #16532
Describe the Bug
Ionic-Angular v4-beta.17 doesn't handle correctly long text in ion-segment-button. It seems that no max width applies and therefore that no ellipsis would be displayed.
Thanks! I was able to reproduce this. I'm not sure of the best solution right now without looking into it more, but as a temporary fix you can add the following:
Note: make sure you are wrapping your segment text in an ion-label and if you are placing icons on the top it needs to have the layout="icon-top" property added to look the best. This is something I want to look into fixing (the requirement to set the layout) but I haven't had a chance to yet.
@camwiegert do you have any ideas on this? Maybe something with label changed in the shuffle?
changed the title [-][v4-beta.17] ion-segment > ion-segment-button > span.width & ellipsis not ok[/-][+]bug: segment button does not truncate long text correctly[/+]on Feb 3, 2023
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.
Activity
manucorporat commentedon Nov 30, 2018
Hey David! can you submit a PR? let me know if you need any assistance!
peterpeterparker commentedon Nov 30, 2018
@manucorporat I wish but, not joking, I didn't figure out how to solves it properly 🤔
brandyscarney commentedon Nov 30, 2018
Thanks! I was able to reproduce this. I'm not sure of the best solution right now without looking into it more, but as a temporary fix you can add the following:
See this codepen here: https://codepen.io/brandyscarney/pen/aQPQaz?ionic:mode=ios
Note: make sure you are wrapping your segment text in an
ion-labeland if you are placing icons on the top it needs to have thelayout="icon-top"property added to look the best. This is something I want to look into fixing (the requirement to set the layout) but I haven't had a chance to yet.@camwiegert do you have any ideas on this? Maybe something with label changed in the shuffle?
peterpeterparker commentedon Dec 1, 2018
thx a lot @brandyscarney, your solution works just fine right now 👍 don't know why I was trying so hard to use
span😂p.s.: in my app, I had to do the following for a
ion-segmentI use inside anion-content, if that could help someone too:[-][v4-beta.17] ion-segment > ion-segment-button > span.width & ellipsis not ok[/-][+]bug: segment button does not truncate long text correctly[/+]feat(segment): display segment as a grid and add an ellipsis to overf…
liamdebeasi commentedon Jun 5, 2023
Hi everyone,
This was fixed in #27457 and will be available in an upcoming minor release of Ionic 7.
ionitron-bot commentedon Jul 5, 2023
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.