Skip to content

Commit 6ec4b4b

Browse files
fix(theme-picker) fix theme picker bugs on mobile
Closes angular#495
1 parent 8a0eb75 commit 6ec4b4b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/app/shared/theme-picker/theme-picker.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ export class ThemePicker {
6363
if (theme.isDefault) {
6464
this.styleManager.removeStyle('theme');
6565
} else {
66-
this.styleManager.setStyle('theme', `assets/${theme.href}`);
66+
// use timout to fix https://github.com/angular/material.angular.io/issues/495
67+
setTimeout(() => {
68+
this.styleManager.setStyle('theme', `assets/${theme.href}`);
69+
});
6770
}
6871

6972
if (this.currentTheme) {

0 commit comments

Comments
 (0)