Skip to content

bug(mat-form-field): Form field with icon prefix or suffix makes long label overflow  #26558

Closed
@domestack

Description

@domestack

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

When using mat-form-field together with prefix or suffix and long label, label is overflowing input box. Seems that text-overflow: ellipse doesn't account for suffix neither prefix width.

`

info_outline Very very very very very long label
Very very very very long label
`

Reproduction

Steps to reproduce:

  1. Create mat-form-field with matIconSuffix or matIconPrefix.
  2. Create mat-label with long text.
  3. If label text is wider than input box, then label is overflowing it.

Expected Behavior

Label should not overflow input box.

Actual Behavior

Screenshot 2023-02-02 193358

Environment

  • Angular: 15.1.2
  • CDK/Material: 15.1.2
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/form-field

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions