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

bug: long text with max width not truncating in button #8700

Closed
alan-agius4 opened this issue Oct 14, 2016 · 4 comments · Fixed by #27547
Closed

bug: long text with max width not truncating in button #8700

alan-agius4 opened this issue Oct 14, 2016 · 4 comments · Fixed by #27547
Labels
package: core @ionic/core package type: bug a confirmed bug report

Comments

@alan-agius4
Copy link
Contributor

alan-agius4 commented Oct 14, 2016

Short description of the problem:

Long text in buttons is not being truncated. I am using full and block buttons

image

While the button does have the ellipsis, as show below;

.button {
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

This doesn't work, as the .button-inner class has display: flex

What behaviour are you expecting?

Display ellipsis.

image

This can be done by setting the display of .button-inner to inline. However, I don't really know the reason for it's display being flex.

Which Ionic Version? 2 RC.0

@alan-agius4 alan-agius4 changed the title Long text in buttons is not being truncated Long text in buttons not being truncated Oct 14, 2016
@jgw96 jgw96 added css labels Oct 14, 2016
@brandyscarney brandyscarney added this to the 2.0.0-rc.4 milestone Nov 21, 2016
@ncapito
Copy link
Contributor

ncapito commented Nov 28, 2016

I think the flex is there to help with centering? Not sure how you all would want to fix it, but the only way I have been able to fix something like this is to give it another inner child. e.g.


<button ion-button full block>
  <span class='overflow-me'>button[ion-button][block] with other really long text that will cause an overflow</span>
 </button>

I then put a class on .overflow-me to do the ellipsis.

   .overflow-me{
    overflow: hidden;
    text-overflow: ellipsis;
   }

@brandyscarney
Copy link
Member

This is actually pretty complex since buttons are used in so many components. Adding an inner div to buttons would cause issues elsewhere, and changing the display from flex to inline causes issues with buttons containing icons and anchor links styled to look like buttons. I am going to remove this from the milestone for now since the code above by @ncapito works, but I'll revisit this issue.

@brandyscarney brandyscarney removed this from the 2.0.0-rc.4 milestone Dec 5, 2016
@ionitron-bot
Copy link

ionitron-bot bot commented Mar 26, 2018

Thanks for the issue! This issue is being closed due to inactivity. 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.

Thank you for using Ionic!

@ionitron-bot ionitron-bot bot closed this as completed Mar 26, 2018
@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Mar 26, 2018
@brandyscarney brandyscarney reopened this Aug 22, 2018
@adamdbradley adamdbradley added the ionitron: v3 moves the issue to the ionic-v3 repository label Nov 1, 2018
@imhoffd imhoffd removed the ionitron: v3 moves the issue to the ionic-v3 repository label Nov 28, 2018
@Ionitron Ionitron added the ionitron: v3 moves the issue to the ionic-v3 repository label Nov 28, 2018
@imhoffd imhoffd added package: core @ionic/core package and removed ionitron: stale issue ionitron: v3 moves the issue to the ionic-v3 repository labels Nov 28, 2018
@brandyscarney brandyscarney added type: feature request a new feature, enhancement, or improvement and removed css labels Nov 29, 2018
@liamdebeasi liamdebeasi changed the title Long text in buttons not being truncated bug: long text with max width not truncating in button Jul 5, 2022
@liamdebeasi liamdebeasi added type: bug a confirmed bug report and removed type: feature request a new feature, enhancement, or improvement labels Jul 5, 2022
mapsandapps added a commit that referenced this issue Dec 12, 2023
Issue number: resolves #8700

BREAKING CHANGE: Button text now wraps by default.
@mapsandapps
Copy link
Contributor

Thank you for submitting this issue.

Starting in Ionic Framework 7.2, we encouraged developers to opt in to text wrapping in buttons by setting ion-text-wrap. This is available now if you are on Ionic 7.2+.

As a result of the changes merged in #28682, text wrapping of buttons will be the default behavior starting in Ionic version 8.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: bug a confirmed bug report
Projects
None yet
9 participants