Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support changing theme dynamically on Input Group #8619

Closed
pmoleri opened this issue Nov 19, 2020 · 1 comment · Fixed by #8791
Closed

Support changing theme dynamically on Input Group #8619

pmoleri opened this issue Nov 19, 2020 · 1 comment · Fixed by #8791

Comments

@pmoleri
Copy link

pmoleri commented Nov 19, 2020

Problem

I need to change the theme in runtime using TaaS, but Inputs groups fail to update.

After changing my theme from Fluent to Material the labels still look as in fluent:
image

Related to this there's a problem. Even if I'm not switching themes, if the stylesheet hasn't loaded by the time the Input Group was rendered then it will default to material even after it finishes loading.
image

Solution

I don't have a clear solution to this. Input Groups could observe some global theme property that I can update using a service.
I think this was @damyanpetev suggestion.

Alternatives

I could destroy the view and force it to render from scratch so it infers the new theme.
This could be easily achieved with a fake *ngFor on an array with a single theme property.

@simeonoff
Copy link
Collaborator

simeonoff commented Nov 20, 2020

We could have a mutation observer that forces re-render of the input group instance whenever the theme changes. I even discussed this limitation with the team before merging the changes done to the input group and how the theming works there. We, however, decided that this is an edge case, and we shouldn't pay too much attention to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants