Skip to content

bug(form-field): Extra space in Outline MatFormField Notch when label content is empty #30984

Open
@kjteh

Description

@kjteh

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

Extra space in Outline MatFormField Notch when the width of the label is 0.

Image

Reproduction

StackBlitz link: https://stackblitz.com/edit/components-issue-starter-otgsx4ue?file=src%2Fmain.ts

Expected Behavior

The extra space (padding-right: 8px) SHOULD BE REMOVED if the label content is empty, when

  • floatLabel = always OR
  • floatLabel = auto AND there is value filled in to the form field.

The padding-right is being set by following css class:
.mdc-notched-outline--notched .mdc-notched-outline__notch

Actual Behavior

The extra space (padding-right: 8px) is VISIBLE despite the label content is empty, when

  • floatLabel = always OR
  • floatLabel = auto AND there is value filled in to the form field.

Environment

Angular CLI: 19.2.2
Node: 18.20.4
Package Manager: yarn 4.4.1
OS: win32 x64

Angular: 19.2.2
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.1902.2
@angular-devkit/build-angular 19.2.2
@angular-devkit/core 19.2.2
@angular-devkit/schematics 19.2.2
@angular/cdk 19.2.3
@angular/material 19.2.3
@schematics/angular 19.2.2
ng-packagr 19.2.0
rxjs 7.8.1
typescript 5.6.3
zone.js 0.15.0

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