angular / angular/components

bug(mat-label): mat-label overlap control and does not show ellipsis

Open
#26,337 4 comments 4 reactions 0 assignees View on GitHub
area: material/form-field P3
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

### Is this a regression?

- [X] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

I'm not 100% sure, but it worked before

### Description

The `mat-label` does not wrap the text with ellipsis anymore in the `mat-datepicker`. Instead the text goes over the icon/control itself.
![image](https://user-images.githubusercontent.com/10813063/209828378-07701cfa-ebab-4ea3-958c-593031815d69.png)

```

To long to show all text


```

### Reproduction

Steps to reproduce:
1. Simple add create a mat-datepicker with a mat-label with new version 15.x

[Stackblitz](https://stackblitz.com/edit/angular-cv9udr-pxxmf6?file=src/app/datepicker-overview-example.ts) is available

### Expected Behavior

Before the text was trimmed with ellipsis like this:

![image](https://user-images.githubusercontent.com/10813063/209828983-f1a206c8-511a-4231-b99a-c610291106bb.png)

### Actual Behavior

Now is go outside the control/over the icon:

![image](https://user-images.githubusercontent.com/10813063/209828378-07701cfa-ebab-4ea3-958c-593031815d69.png)

### Environment

- Angular: 15.0.4
- CDK/Material: 15.0.3
- Browser(s): (Chrome, Edge, Firefox)
- Operating System: MacOS

Contributor guide

Open the contributing guide

Research direction

Start with the linked StackBlitz reproduction and compare the Angular 15 mat-datepicker and mat-form-field label behavior with the previous version. Trace how the mat-label is rendered beside the datepicker toggle, then verify that a long label is ellipsized without overlapping the control and add regression coverage for the reproduced case.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.