angular / angular/components

bug(form-field): form field prefix in overlay

Offen
#29,064 2 Kommentare 6 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area: material/form-field P4
Vorherrschende Sprache
TypeScript
Sterne
25k
Forks
6.8k
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
91

Beschreibung

### 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

The issue is about the missing padding for the label when using a form field inside an overlay with ng-content. It can be easily reproduced in stackblitz, I will provide a link where it can be seen how is misbehaving. Without ng-content, everything works fine.

### Reproduction

StackBlitz link:
Steps to reproduce:
1. click on open

https://stackblitz.com/edit/ipwssz-9pucs5?file=src%2Fexample%2Fcdk-overlay-basic-example.html

### Expected Behavior

The label should be positioned after the prefix.

### Actual Behavior

The label transition is not working properly.

### Environment

_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/

Angular CLI: 17.3.0
Node: 18.18.0
Package Manager: yarn 1.22.19
OS: linux x64

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

Package Version
------------------------------------------------------------
@angular-devkit/architect 0.1703.0
@angular-devkit/build-angular 17.3.0
@angular-devkit/core 17.3.0
@angular-devkit/schematics 17.3.0
@angular/cdk 17.3.6
@angular/material 17.3.6
@angular/material-experimental 17.3.6
@angular/material-moment-adapter 17.3.6
@schematics/angular 17.3.0
rxjs 7.4.0
typescript 5.4.2
zone.js 0.14.0

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit der StackBlitz-Reproduktion in src/example/cdk-overlay-basic-example.html und verfolge den Fall des form-field-Präfixes innerhalb des Overlays unter Verwendung von ng-content. Reproduziere das Problem, indem du auf Open klickst, und überprüfe anschließend, dass das Label nach dem Präfix positioniert ist und seine Transition korrekt funktioniert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
angular, typescript
Bereich
frontend
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.