angular / material

Material design for AngularJS
https://material.angularjs.org/
MIT License
16.56k stars 3.39k forks source link

dialog: text in the dialog stays bolded permanently after the dialog animation ends on macOS #10067

Open rvarbanov opened 7 years ago

rvarbanov commented 7 years ago

Actual Behavior:

CodePen (or steps to reproduce the issue): *

Angular Versions: *

Additional Information:

Maybe a screenshot will help:

screen shot 2016-11-29 at 9 32 41 am

EDIT: Included a gif to better demo the issue 2016-12-01 09_57_36

EDIT 2: Also, if I go into Developer Tools and disable a style it all the test in the dialog will update to normal. E.g., if I disable to background-color of a button all the text of the dialog will visually change to normal.

bradrich commented 7 years ago

Hello @rvarbanov! The input that you are referring to in the prompt dialog is using md-autofocus. Removing this causes the input to remain unfocused until you interact with it. Having said all of that, I removed this attribute and the input was not bold.

So, time for some quick questions:

rvarbanov commented 7 years ago

Hi @bradrich, quick question, did you follow the steps to reproduce? Did you see the issue on the AM demo page?

bradrich commented 7 years ago

I was not able to reproduce the issue.

I would recommend using ng-cloak within your application. The necessary CSS is already supported through Angular Material, so all you have to do is to add the ng-cloak attribute to a HTML element and the directive will handle the rest. As I am not able to reproduce the issue, I am not sure if this will fix it, but it is definitely a tool to use.

rvarbanov commented 7 years ago

I tried using ng-cloak on the HTML tag but had no effect on the issue I am experiencing.

Today I noticed the input labels and placeholders are also bolded, and when I click into the input (focus the input) they go back to normal.

Here is a demo: 2016-12-01 09_57_36

Edit: Also, if I go into Developer Tools and disable a style it all the test in the dialog will update to normal. E.g., if I disable to background-color of a button all the text of the dialog will visually change to normal.

svencowart commented 7 years ago

I am experiencing the same issue on Chrome. This is not an appropriate fix because it removes the nice opening and closing animations of the md-dialog, but I could prevent the fonts from being bold by setting transition to none on the md-dialog element:

md-dialog {
    transition: none !important;
}

I could be wrong about this but after some research I am lead to believe it has to do with Chrome's affect on anti-aliasing triggered by transition effects.

svencowart commented 7 years ago

@bradrich I am using Chrome 55.0.2883.95 and I can see this problem on the demo page (https://material.angularjs.org/latest/demo/dialog). Just inspect the md-dialog element and uncheck the transition property and you can see all the text within a dialog return to the appropriate weight.

Using ng-cloak on the md-dialog component works, but also kills the opening animation which is obviously not the solution.

meetbryce commented 7 years ago

Found an alternative hack for this.

If you show a spinner while the dialog is opening, then only reveal the real content after the transition has finished you don't see the bug.

I implemented this by adding an artificial 400ms delay to mdDialogs being opened without an async request. I used $timeout(() => { $ctrl.state.loading = false; }, 400);

Splaktar commented 5 years ago

We use the following related, non-standard style for macOS:

html, body {
  -webkit-font-smoothing: antialiased;
}

However, I tried all of the possible values and they did not improve the situation here.

I can reproduce (CodePen) the fact that the text of the whole dialog (not just inputs) first appears as slightly bolded before transitioning to normal (its final state).

I cannot reproduce the case where the text in a dialog never reaches the final state and stays permanently bolded. If this is still reproducible, please provide an updated set of reproduction steps.