Components: Prefixed Form-Field-Outline-Label-Gap not positioned correctly in Mat-Dialog in 7.0.1

Created on 23 Oct 2018  路  10Comments  路  Source: angular/components

Bug:

Form-Field-Outline-Label-Gap does not reposition correctly when it is opened in a dialog and the Form-Field has a prefix
screenshot 2018-10-23 at 11 30 50 am

What is the expected behavior?

The Form-Field-Outline-Label-Gap should be positioned correctly with or without a prefix.

What is the current behavior?

The Form-Field-Outline-Label-Gap does not reposition itself away from the form field prefix like the label does when it is opened in a dialog.

What are the steps to reproduce?

https://stackblitz.com/edit/form-field-outline-label-gap-position-error-in-dialog-701

What is the use-case or motivation for changing an existing behavior?

(not applicable)

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular 7.0.0
Angular Material 7.0.1
Chrome 69, Safari 12.0

Is there anything else we should know?

This seems related to #12782

Most helpful comment

This issue is still there in 7.2.0

To be clear, this happens when ouline gap is calculated before the label and container rendering being stable. I tried pausing the "updateOutlineGap" function when open the dialog and release it after all components are rendered, then the gap is correct.

Please reopen this issue.

All 10 comments

I don't think mat-dialog has anything to do with it. You can reproduce it by taking the demo and just changing the form fields to use appearance="outline"

image

@aeslinger0 , I am referring to the gap in the field outline that is for the mat-label when it is raised.

I believe that you are referring to the prefix/suffix not being aligned to the input characters.
For that, I found this issue #11831 that already addresses it.

Yes, you're right. My mistake.

Closing as duplicate of #11831

@josephperrott , this is not a duplicate of 11831.

11831 is about vertical alignment of characters inside the field.
This is about the horizontal repositioning of the outline gap not taking effect in a one off scenario.

Please take a second look at the issue and consider reopening it.

This issue is still there in 7.2.0

To be clear, this happens when ouline gap is calculated before the label and container rendering being stable. I tried pausing the "updateOutlineGap" function when open the dialog and release it after all components are rendered, then the gap is correct.

Please reopen this issue.

It's still an issue on 7.3.1.

This occurs in any scenario using matPrefix - not just mat-dialog (v7.3.7)

image

<mat-form-field appearance="outline" fxFlex> <mat-label>User Name</mat-label> <mat-icon matPrefix>account_box</mat-icon> <input matInput formControlName="userName" maxlength="50" required> <mat-error>User Name is required</mat-error> </mat-form-field>

I have the same issue

@josephperrott could you please consider above comments

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

constantinlucian picture constantinlucian  路  3Comments

vanor89 picture vanor89  路  3Comments

jelbourn picture jelbourn  路  3Comments

alanpurple picture alanpurple  路  3Comments

savaryt picture savaryt  路  3Comments