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 Textarea is always full width #4006

Closed
stevegeek opened this issue Oct 29, 2018 · 1 comment · Fixed by #4035
Closed

TextField Textarea is always full width #4006

stevegeek opened this issue Oct 29, 2018 · 1 comment · Fixed by #4035
Labels
Milestone

Comments

@stevegeek
Copy link

Bugs

Please see https://codepen.io/anon/pen/aRxpXL . Note that no matter how the text area is specified it takes the full width of its container, unlike the Text field.

The demo https://material-components.github.io/material-components-web-catalog/#/component/text-field seems to indicate that it should be possible to create a text area which is not full width as there is a section for 'full width' versions of the textarea compared to those show above them.

What MDC Web Version are you using?

0.40.1

What browser(s) is this bug affecting?

Safari, Chrome

What are the steps to reproduce the bug?

See the codepen

What is the expected behavior?

If mdc-text-field--fullwidth is not specified, the textarea should size according to say the rows attribute, and not take the full width of its container.

What is the actual behavior?

The textarea always fills its container.

Any other information you believe would be useful?

I believe this is because the textarea is defined with display: flex and width: auto result in this behaviour https://github.com/material-components/material-components-web/blob/master/packages/mdc-textfield/_mixins.scss#L481

@kfranqueiro
Copy link
Contributor

Thanks for reporting this. It does seem like perhaps we should be using inline-flex rather than flex by default, given that textareas are inline or inline-block natively. We'll investigate whether this leads to any undesirable effects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants