Components: [Universal] Buttons are missing the appropriate classes in the server rendered document

Created on 9 Feb 2018  路  9Comments  路  Source: angular/components

Bug, feature request, or proposal:

[ x ] Bug

What is the current behavior?

Buttons are missing the mat-button, mat-raised-button, mat-icon-button, mat-fab, mat-mini-fab class in the server rendered view (only the theming class is present: mat-warn etc.). Therfore, the elements don't get any styles applied.

What is the expected behavior?

Buttons should have the same classes applied in the server rendered view as when the client bootstraps.

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

Angular CLI: 1.6.8
Node: 8.9.4
OS: win32 x64
Angular: 5.2.4
@angular/cdk: 5.2.0
@angular/material: 5.2.0

Is there anything else we should know?

It was working fine with 5.1.0. Haven't tested on 5.1.1
This happened after updating CDK & Material to 5.2.0

P3 has pr

Most helpful comment

Should be fixed by #9771.

All 9 comments

Should be fixed by #9771.

Same here.

any idea when this will be fixed/merged? https://universal-demo.ereckgordon.com/ you can see the bug super obviously when running a lighthouse report.

Considering this is still pending any thoughts on a workaround @crisbeto to bypass the failing check for _hasHostAttributes?

Just put button classes in the class attribute - . It works like charm

@abeninski We can do that, of course. But just as a workaround or if your app is in production and you absolutely want to use a Material version >=5.2.0.
But I still had to open an issue, since this is rather a bug, not the intended behaviour.

@MrCroft I think we all agree, the class solution is a hack and appears to fixed by #9771 I was just asking what the recommended way to work with 5.2.0+ is. I guess I'll just stick with the class hack for the moment.

Looks like the related fix has been merged and released for a long time now. Closing.

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

dzrust picture dzrust  路  3Comments

alanpurple picture alanpurple  路  3Comments

LoganDupont picture LoganDupont  路  3Comments

julianobrasil picture julianobrasil  路  3Comments

jelbourn picture jelbourn  路  3Comments