- 
                Notifications
    You must be signed in to change notification settings 
- Fork 6.8k
Open
Labels
GThis is is related to a Google internal issueThis is is related to a Google internal issueP2The issue is important to a large percentage of users, with a workaroundThe issue is important to a large percentage of users, with a workaroundarea: material/form-field
Description
Affected component[s]: Form field
Observed behavior:
Outlined input's floating label does not comply with custom typography -- only applies to MDC component.
In addition, MDC component does not shrink in height the same way the non-MDC component does -- not sure why this would be
To actually reproduce this, you unfortunately need to create two separate modules and export two separate components so the [matInput] directives don't collide, but this is the gist of the repro case:
Code:
<div class="non-mdc">
  <mat-form-field appearance="outline">
    <mat-label>Non-MDC label</mat-label>
    <input matInput placeholder="A placeholder"  />
  </mat-form-field>
</div>
<div class="mdc">
  <mat-form-field appearance="outline">
    <mat-label>MDC label</mat-label>
    <input matInput placeholder="A placeholder"  />
  </mat-form-field>
</div>.non-mdc {
  @include mat.form-field-theme($app-theme); // some init theme
}
$small-typography: mat.define-typography-level(12px, 16px, 400, $roboto-font, 0.3px);
$form-field-typography: mat.define-typography-config(
  $body-2: $small-typography,
  $subheading-1: $small-typography,
  $input: $small-typography,
);
.mdc {
  @include mat.mdc-form-field-theme($app-theme); // some init theme
  @include mat.mdc-form-field-typography($form-field-typography);
}
.mdc,
.non-mdc {
  font-size: 12px;
}Screen recording:
Unnamed.screen.capture.4.mp4
Expected behavior:
- Floating label is definitely wrong
- Feature parity with upgrade re: input height auto-resizing may be desirable, not sure. May also be related to the first problem somehow
Metadata
Metadata
Assignees
Labels
GThis is is related to a Google internal issueThis is is related to a Google internal issueP2The issue is important to a large percentage of users, with a workaroundThe issue is important to a large percentage of users, with a workaroundarea: material/form-field