angular / angular/components

bug(mat-form-field): Input and Select have different height

Open
#24,612 5 comments 0 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?

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

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

_No response_

### Description

If I put a Input-FormField next to a FormField with a MatSelect, there seems to be a height difference of 0.875px

![image](https://user-images.githubusercontent.com/50733002/158801044-c1ddfc15-e422-4504-a2cf-69a1f07e53f7.png)

### Reproduction

Steps to reproduce:
1. Just put both next to each other an check height using DevTools

https://stackblitz.com/edit/angular-3dch32?file=src/app/form-field-overview-example.ts

### Expected Behavior

Both MatFormFields should have the same height.

### Actual Behavior

The MatFormField with the MatSelect inside seems to be 0.875px taller.

### Environment

- Angular:
- CDK/Material: 13.2.6
- Browser(s): Google Chrome 99.0.4844.51
- Operating System (e.g. Windows, macOS, Ubuntu): Windows

Contributor guide

Open the contributing guide

Research direction

Start with the linked StackBlitz reproduction at src/app/form-field-overview-example.ts and compare the rendered input and select MatFormFields in Chrome DevTools. Trace the height difference in the Material form-field styles; done means adjacent fields have equal heights and the reproduction no longer shows the 0.875px discrepancy.

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
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.