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

[ToolbarTitle] Long text string wraps below toolbar #3192

Closed
devnacho opened this issue Feb 5, 2016 · 9 comments · Fixed by #3548
Closed

[ToolbarTitle] Long text string wraps below toolbar #3192

devnacho opened this issue Feb 5, 2016 · 9 comments · Fixed by #3548
Labels
bug 🐛 Something doesn't work

Comments

@devnacho
Copy link

devnacho commented Feb 5, 2016

Hey guys,

When I put a long text in ToolbarTitle it disappears with smaller screens.
bug1

This issues is really similar to this one: #823

My Material-ui version is 0.14.2

Thanks!!

@mbrookes mbrookes changed the title Too [ToolbarTitle] Long text string wraps below toolbar Feb 5, 2016
@mbrookes mbrookes added the bug 🐛 Something doesn't work label Feb 5, 2016
@tintin1343
Copy link
Contributor

Proposed Solution

I was able to solve this by from my interpretation of the problem and by consulting the fellow collaborators.

What I did was that I converted a long title text based on the number of characters in the title into ellipsis if it exceeds the condition on the number of characters as mentioned below. If the text is smaller than 40 characters then it inherit the width of the parent element.

The highlighted text in the below screenshot are the needed changes. The changes are to be included in the toolbar-title.jsx file:

screen shot 2016-02-08 at 4 23 19 pm

This leads to the following change:
a) When its a long string :
screen shot 2016-02-08 at 5 26 42 pm

b) when its a small string:
screen shot 2016-02-08 at 5 28 27 pm

Having said that, I would want to make a point here. The use case for the title component would be to include a short text in the title. However, the rendering of the title text will also depend on the number of the components being included in the ToolbarGroup Component which is the parent of the ToolbarTitle Component. E.g: If we have too many components in the ToolbarGroup the Title will be cut short anyway and won't serve the purpose. So, It basically depends on the design and the use case of the person implementing it.

@devnacho: you could either change the width property here by either mentioning the width manually (width: 150) or by using the below line and that should solve your problem:

    `width: (this.props.text.length > 40) ? 150 : 'inherit',`

@mbrookes : If this solution sounds alright I could issue a pull request.

@tintin1343
Copy link
Contributor

@oliviertassinari : Can we close this issue? The PR for this was merged last week. Thanks !

@oliviertassinari
Copy link
Member

@tintin1343 We still have the following issue:
capture d ecran 2016-02-12 a 00 16 18
I'm not sure that we should close it.

@tintin1343
Copy link
Contributor

Alright. I guess we can close it after redesign of the component.

@newsiberian
Copy link
Contributor

Hi, we have the similar issue with:
[SelectField] before:
dropdown_opened
selected
dropdown_selected

and with [TextField] floatingLabelText:
textbox

@tintin1343
Copy link
Contributor

@mbrookes : Can this be closed now?

@alitaheri
Copy link
Member

Yes thank you 👍

@mbrookes
Copy link
Member

@tintin1343 - https://help.github.com/articles/closing-issues-via-commit-messages/

Convention is to put it at the bottom of your PR description: http://chris.beams.io/posts/git-commit/, but anywhere will work

@tintin1343
Copy link
Contributor

@tintin1343 - https://help.github.com/articles/closing-issues-via-commit-messages/

Convention is to put it at the bottom of your PR description: http://chris.beams.io/posts/git-commit/, but anywhere will work

Thanks Matt! I did not know this. Really helpful!

tintin1343 added a commit to tintin1343/material-ui that referenced this issue Mar 1, 2016
Incorporate flexbox design in the existing design of toolbar.

Resolves mui#3192
tintin1343 added a commit to tintin1343/material-ui that referenced this issue Mar 1, 2016
Incorporate flexbox design in the existing design of toolbar.

Resolves mui#3192
tintin1343 added a commit to tintin1343/material-ui that referenced this issue Mar 2, 2016
Incorporate flexbox design in the existing design of toolbar.

Resolves mui#3192
tintin1343 added a commit to tintin1343/material-ui that referenced this issue Mar 3, 2016
Incorporate flexbox design in the existing design of toolbar.

Resolves mui#3192
tintin1343 added a commit to tintin1343/material-ui that referenced this issue Mar 6, 2016
Incorporate flexbox design in the existing design of toolbar.

Resolves mui#3192
mbradleyis pushed a commit to staticinstance/material-ui that referenced this issue Mar 7, 2016
Incorporate flexbox design in the existing design of toolbar.

Resolves mui#3192
und3fined pushed a commit to und3fined/material-ui that referenced this issue Mar 22, 2016
Incorporate flexbox design in the existing design of toolbar.

Resolves mui#3192
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants