Skip to content

bug(mat-form-field): 'cols' attribute of <textarea> does not work with mat-form-field #29459

Closed
@coralie6626

Description

@coralie6626

Description

When using to wrap a <textarea>, setting a value for 'cols' attribute does not change the width of the <textarea>. This caused some consistency issues since the 'rows' attribute (which is used to set the height of <textarea>) still working as intended.

Reproduction

StackBlitz link: StackBlitz Example
Steps to reproduce:

  1. wrap <textarea> with mat-form-field
  2. change cols attribute value

Expected Behavior

The visible width of the <textarea> should be set according to the value of 'cols'.

Actual Behavior

Modifying 'cols' attribute value does not have any effect on the width of the <textarea>.

Environment

  • Angular: ^18.0.0
  • CDK/Material: ^18.0.0
  • Browser(s): Google Chrome 126.0.6478.128 (Official Build) (64-bit)
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4A relatively minor issue that is not relevant to core functionsarea: material/form-field

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions