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

[ListItem] Overflow for primaryText #4704

Closed
finaiized opened this issue Jul 13, 2016 · 3 comments
Closed

[ListItem] Overflow for primaryText #4704

finaiized opened this issue Jul 13, 2016 · 3 comments
Labels
component: list This is the name of the generic UI component, not the React module! v0.x

Comments

@finaiized
Copy link

finaiized commented Jul 13, 2016

Problem description

The ListItem component with primaryText overflows it's container. Unlike secondaryText, there is no option to set the number of lines before overflow, and there is no overflow behaviour by default. I think it's possible to target the div the text is rendered in by setting a className on the ListItem, then finding the first child div's second div, but that seems error-prone because it depends on the generated HTML.

Steps to reproduce

  1. Create a ListItem within a List, and set it's primaryText to a long enough string to cause overflow.
  2. The text will overflow the end of the list.

Versions

  • Material-UI: 0.15.2
  • React: 15.2.0
  • Browser: Safari 10
@nehalbhanushali
Copy link

@finaiized In my opinion,primaryText is meant for titles and secondaryText for description, which is why the format is kept that way. A text shouldn't be so long as to overflow. Otherwise the overflow : hidden style along with other styles preventing overflow can be given to primaryText style as well just like those in secondaryText and a PR can be made.

@aahan96
Copy link
Contributor

aahan96 commented Jul 20, 2016

@finaiized Looks like a solution for this has been posted. However, primaryText should not be so long that wrapping of texts takes place and I don't think implementing this in MUI project will benefit other users! 😄

@aahan96 aahan96 closed this as completed Jul 20, 2016
@justinmc
Copy link

justinmc commented Dec 6, 2016

I realize this is old, but just to throw my two cents in... Why don't we just make the primaryText show an ellipsis on overflow by default? Sure maybe primaryText shouldn't be so long that it overflows, but if it does, shouldn't it just show the ellipsis instead of overflowing and looking broken? I don't see a reason not to just implement that by default, unless there is something else that depends on it being overflow: visible.

@oliviertassinari oliviertassinari added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 21, 2022
@zannager zannager added component: list This is the name of the generic UI component, not the React module! v0.x and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: list This is the name of the generic UI component, not the React module! v0.x
Projects
None yet
Development

No branches or pull requests

6 participants