Skip to content

Commit 5b23f3e

Browse files
committed
fix(material/form-field): account in cols attribute on textarea
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
1 parent 984723e commit 5b23f3e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/material/form-field/form-field.scss

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,14 @@ $_icon-prefix-infix-padding: 4px;
179179
flex: auto;
180180
min-width: 0;
181181

182-
// Infix stretches to fit the container, but naturally wants to be this wide. We set
183-
// this in order to have a consistent natural size for the various types of controls
184-
// that can go in a form field.
185-
width: 180px;
182+
// We do not to set fixed width on textarea with cols attribute as it makes different columns
183+
// attribute look same width.
184+
:has(:not(textarea[cols])) {
185+
// Infix stretches to fit the container, but naturally wants to be this wide. We set
186+
// this in order to have a consistent natural size for the various types of controls
187+
// that can go in a form field.
188+
width: 180px;
189+
}
186190

187191
// Needed so that the floating label does not overlap with prefixes or suffixes.
188192
position: relative;

0 commit comments

Comments
 (0)