From b140257ca9b66700673945b46dcb8bcbaf3007fe Mon Sep 17 00:00:00 2001 From: naaajii Date: Sun, 6 Oct 2024 20:25:59 +0500 Subject: [PATCH] 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 --- src/material/form-field/form-field.scss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/material/form-field/form-field.scss b/src/material/form-field/form-field.scss index d796ecb06e1a..c2787b1a1427 100644 --- a/src/material/form-field/form-field.scss +++ b/src/material/form-field/form-field.scss @@ -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.