components icon indicating copy to clipboard operation
components copied to clipboard

MdDialogModule does not work with dynamic theming

Open melocotton opened this issue 9 years ago • 4 comments

Bug, feature request, or proposal:

Bug

What is the expected behavior?

MdDialogModule should also receive css styles when dynamically switching from one css (or scss) to another to apply different themes : our themes are applied to the node, but MdDialogModule is added outside this node (and generated dynamically by javascript at runtime which means its own node is not visible in DOM before actually been displayed when the MdDialogModule is called), thus does not receive the theme.

What is the current behavior?

MdDialogModule does not receive the styles when dynamically switched by user

What are the steps to reproduce?

  • Go to your demo website at : https://material2-app.firebaseapp.com/
  • switch to dark theme
  • click on the "Dialog" button at the bottom of the page -> The dialog does not receive the dark theme

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

Existing behavior is incorrect

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

angular 2.4.1 material 2.0.0-beta.1

Is there anything else we should know?

You are lucky guys, because my collegue might have found a workaround to this issue (using renderer.setElementClass() to inject our theme class in the MdDialogModule), but please fix this ASAP (and also add resources to create the datepicker everyone needs as well).

melocotton avatar Jan 05 '17 13:01 melocotton

Any news on this ?

melocotton avatar Jan 11 '17 16:01 melocotton

@melocotton Did your workaround end up helping get around this? I'm encountering the same issue. If it worked would you be able to share your solution?

Thanks, and I also would appreciate this being changed.

draiche avatar Jan 18 '17 21:01 draiche

This is being worked on. I'll close this issue since it's already tracked via https://github.com/angular/material2/issues/2662.

crisbeto avatar Feb 03 '17 19:02 crisbeto

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.