Material-ui: [SelectField] Overflowing text of selected item breaks into multiple lines

Created on 18 Jan 2016  路  8Comments  路  Source: mui-org/material-ui

When selecting an item with a text larger than the select field, the value gets spread across multiple lines.

I cannot imagine a single situation where this is useful, so I'd recommend changing the default styles to include:

text-overflow: ellipsis;
overflow: hidden;
white-space: pre;

Feel free to propose a better solution :)

Most helpful comment

Still an issue. Selected item wraps to a new line if too long :(

overflow

All 8 comments

I ran into the same issue and arnekolja's arguments and solution seem good to me.

@arnekolja : This no longer happens.

screen shot 2016-04-22 at 1 24 32 pm

When I select the longer text it looks like this:
screen shot 2016-04-22 at 1 25 09 pm

However the solution you provided should work for anyone who has that issue.

I am closing this for now, as its no longer an issue.

This is still a problem. Because the OP solution also hides the errorText.

Still a problem as of material-ui v0.15.2.

Was fixed using OP solution:
<SelectField style={{ textOverflow: "ellipsis", overflow: "hidden", whiteSpace: "pre" }} ... >...</SelectField>

@tintin1343 This was closed prematurely. Still an issue. If you have spaces in a long name, it goes onto the next line (which will cover other components).

The problem appeared again, when we can wait for a fix?

Still an issue. Selected item wraps to a new line if too long :(

overflow

"overflow: hidden" does not solve the problem that the arrow button is overflow, also (besides breaking error text). I think the text will need an extra box which hides the overflow.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sys13 picture sys13  路  3Comments

mb-copart picture mb-copart  路  3Comments

finaiized picture finaiized  路  3Comments

rbozan picture rbozan  路  3Comments

anthony-dandrea picture anthony-dandrea  路  3Comments