Skip to content

Commit

Permalink
fix(material/form-field): account in cols attribute on textarea (#2…
Browse files Browse the repository at this point in the history
…9836)

previously we were setting width of 180px on our input field however this also made that textarea width stays the same if they are used with `cols` attribute, this commit ensures we dont do that if we have a textarea with `cols` attribute allowing it to grow in width as much as the attribute wants it to

fixes #29459

(cherry picked from commit 48b2680)
  • Loading branch information
naaajii authored and crisbeto committed Oct 10, 2024
1 parent 80bfac2 commit ddb55e2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/material/form-field/form-field.scss
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ $_icon-prefix-infix-padding: 4px;
// Needed so that the floating label does not overlap with prefixes or suffixes.
position: relative;
box-sizing: border-box;

// We do not want to set fixed width on textarea with cols attribute as it makes different
// columns look same width.
&:has(textarea[cols]) {
width: auto;
}
}

// In the form-field theme, we add a 1px left margin to the notch to fix a rendering bug in Chrome.
Expand Down

0 comments on commit ddb55e2

Please sign in to comment.