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

MdInput renders suffix's width relative to input width; often too wide #1421

Closed
mark-langer opened this issue Oct 4, 2016 · 3 comments · Fixed by #2496
Closed

MdInput renders suffix's width relative to input width; often too wide #1421

mark-langer opened this issue Oct 4, 2016 · 3 comments · Fixed by #2496
Assignees

Comments

@mark-langer
Copy link

Bug, feature request, or proposal:

Bug

What is the expected behavior?

A suffix that is added to an <md-input> element should only be as wide as the suffix's contents.

What is the current behavior?

The suffix's width is calculated relatively to the width of the entire input. If the input is, let's say, 650px wide, then the suffix renders to approximately 80px, although the suffix's content only has a width of, say, 24px.

What are the steps to reproduce?

Simply set the width of the <md-input> to a large number to see the relative sizing of the suffix.

Plunker: http://plnkr.co/edit/DnK191LGat2o3bnOyTtt?p=preview

What is the use-case or motivation for changing an existing behavior?

The suffix is supposed to go to the very end of the input field. The current behaviour leaves too much white space to the right of the suffix.

Which versions of Angular, Material, OS, browsers are affected?

Tested with Angular 2.0.0, Material 2.0.0-alpha.9 on Firefox 49.0.1, Windows 10

Is there anything else we should know?

A good solution might be styling the div.md-input-table and its children as a flexbox in the MdInputComponent template.

@mmrath
Copy link

mmrath commented Nov 8, 2016

@jelbourn ,@mark-langer would you know of any workaround Style for fixing this?

@mmalerba mmalerba self-assigned this Dec 14, 2016
@mark-langer
Copy link
Author

#1881

@hansl hansl removed their assignment Dec 27, 2016
@crisbeto crisbeto added the has pr label Jan 5, 2017
crisbeto added a commit to crisbeto/material2 that referenced this issue Jan 5, 2017
Prevents the input's suffix and prefix from stretching together with their parent node and leaving some weird spacing between themselves and the input. This was a side-effect of using `display: table-cell`.

Fixes angular#2493.
Fixes angular#1881.
Fixes angular#1421.
tinayuangao pushed a commit that referenced this issue Jan 12, 2017
…nt (#2496)

Prevents the input's suffix and prefix from stretching together with their parent node and leaving some weird spacing between themselves and the input. This was a side-effect of using `display: table-cell`.

Fixes #2493.
Fixes #1881.
Fixes #1421.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants