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

[TextField] Long hint does not work with { whiteSpace: 'nowrap', textOverflow: 'ellipsis' } #6433

Closed
comerc opened this issue Mar 25, 2017 · 8 comments
Labels
component: text field This is the name of the generic UI component, not the React module!

Comments

@comerc
Copy link

comerc commented Mar 25, 2017

2017-03-25 15 25 09

      <TextField
        id="PostFormSourceLink"
        floatingLabelText="Source Link"
        hintText="For example, http://www.oreillynet.com/pub/a/oreilly/tim/news/2005/09/30/what-is-web-20.html?page=1"
        fullWidth={true}
        hintStyle={{ whiteSpace: 'nowrap', textOverflow: 'ellipsis' }}
      />

Versions

  • Material-UI: 0.17.1
  • React: 15.4.2
  • Browser: Chrome 52
@comerc comerc changed the title [TextField] Long hint does not work with { 'white-space': 'nowrap', 'text-overflow': 'ellipsis' } [TextField] Long hint does not work with { whiteSpace: 'nowrap', textOverflow: 'ellipsis' } Mar 25, 2017
@mbrookes mbrookes added the component: text field This is the name of the generic UI component, not the React module! label Mar 25, 2017
@oliviertassinari
Copy link
Member

We have been porting the component on the next branch. We reimplemented it from the ground-up. While we haven't tested it, I think that the issue is most likely fixed on that branch. Hence, I'm closing it.

@ilovett
Copy link

ilovett commented Jul 6, 2018

hintStyle={{
  textOverflow: 'ellipsis',
  whiteSpace: 'nowrap',
  width: '100%',
  overflow: 'hidden'
}}

@lamqson
Copy link

lamqson commented Sep 17, 2019

Hi, I don't think the issue has been fixed it yet. Could you re-open?

@eyerean
Copy link

eyerean commented Dec 11, 2019

Facing a similar issue with the placeholder in TextField, in Chrome and Edge. Long text is cut but the ellipsis is not displayed. In Firefox it works as expected.

@kylane
Copy link

kylane commented Dec 23, 2020

Same here.

@JG145
Copy link

JG145 commented Jan 20, 2021

Same here

@xmatusk3
Copy link

xmatusk3 commented Feb 3, 2021

My solution to this was to overwrite mui theme in a custom theme.json. I used css provided by @ilovett with a small tweak because of a our heavy usage of outlined inputs where the padding of the outlined element had to be substracted. Also icons at the end of the text field (for example down carets in selectors or calendar icon in date picker) have some extra width so I substracted 20px for the padding and 30px for the icon to make everything fit. Many text inputs use label shrinking where the label is put on the top of the input in a shrunk style - therefore the custom css has to be removed there.

{
  "overrides": {
    "MuiInputLabel": {
      "root": {
        "width": "calc(100% - 50px)",
        "white-space": "nowrap",
        "overflow": "hidden",
        "text-overflow": "ellipsis"
      },
      "shrink": {
        "width": "unset",
        "white-space": "unset",
        "overflow": "unset",
        "text-overflow": "unset"
      }
    }
  }
}

@oliviertassinari
Copy link
Member

@xmatusk3 see #12255 for the overflow issue with the label. This issue is about the placeholder (from what I understand)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: text field This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

9 participants