Material: chips: placeholder is truncated even though there is room for it in the component

Created on 28 Apr 2017  路  8Comments  路  Source: angular/material

Actual Behavior:

  • What is the issue?*
    Long placeholder on md-autocomplete is cut
  • What is the expected behavior?
    Full placeholder should be seen

CodePen (or steps to reproduce the issue): *

AngularJS Versions: *

  • AngularJS Version:v1.5.5
  • AngularJS Material Version:v1.1.1

Additional Information:

  • Browser Type: *Chrome
  • Browser Version:* 58.0.3029.81 (64-bit)
  • OS:* Ubuntu 16.04
  • Stack Traces:
required sync Pull Request fixed regression bug polish

All 8 comments

This is related to https://github.com/angular/material/issues/10344, but not a duplicate.

Here's a CodePen that demonstrates the issue when using chips without autocomplete.

Hi has there been any progress on this issue?

There has been progress, but no solution is available yet. I submitted PR https://github.com/angular/material/pull/11098 which is needed before this issue can be solved, but it ran into some presubmit failures (breaking changes). I need to re-visit that PR, fix the issues, and re-submit. I don't have an ETA, but both chips and autocomplete are due for some fairly significant bug and a11y fixes in 1.1.10+.

I was pretty confident in my approach in #11276 and we're testing it now internally. If you want me to get involved, let me know. Otherwise I'll patiently wait for the official fix :)

@oliversalzburg thank you very much. I will review your suggestion and see if it can be used in the existing PR. I'll let you know how it goes.

@Splaktar the fix suggested by @oliversalzburg works fine. There is a problem when the window is too small to fit the chips and the placeholder text. The placeholder text is not moved into a new line unless the window is small enough to show a substring containing only "Very Long Placeholder For".

image

image

CodePen

I recall that there were some keyboard/focus/a11y issues that needed to be solved beyond just those suggested changes. I need to dig into this again for sure. I've bumped the priority back up.

Yeah, I think that fix mostly works now that the other fixes have landed. But the last issue is the one you mention here, if you add a long chip, or multiple chips, there are cases where the input gets shrunk too small to show the placeholder.

It seems like we need a min-width, but it also seems like it would vary depending upon the placeholder used.

I think that our best approach for solving this is to add an md-input-class like <md-autocomplete> has. Then the developer can add a min-width that works for their app and placeholder.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rdantonio picture rdantonio  路  3Comments

ghost picture ghost  路  3Comments

chriseyhorn picture chriseyhorn  路  3Comments

achaussende picture achaussende  路  3Comments

nikhildev picture nikhildev  路  3Comments