diff --git a/packages/core/application/application-common.ts b/packages/core/application/application-common.ts index 2a083eb32..d27dee9c5 100644 --- a/packages/core/application/application-common.ts +++ b/packages/core/application/application-common.ts @@ -148,9 +148,14 @@ export function orientationChanged(rootView: View, newOrientation: 'portrait' | applyCssClass(rootModalView, ORIENTATION_CSS_CLASSES, newOrientationCssClass); }); } +export let autoSystemAppearanceChanged = true; + +export function setAutoSystemAppearanceChanged(value: boolean) { + autoSystemAppearanceChanged = value; +} export function systemAppearanceChanged(rootView: View, newSystemAppearance: 'dark' | 'light'): void { - if (!rootView) { + if (!rootView || !autoSystemAppearanceChanged) { return; } diff --git a/packages/core/application/index.d.ts b/packages/core/application/index.d.ts index 9b14fe31c..9d0106c3a 100644 --- a/packages/core/application/index.d.ts +++ b/packages/core/application/index.d.ts @@ -54,6 +54,16 @@ export const orientationChangedEvent: string; */ export const systemAppearanceChangedEvent: string; +/** + * Boolean to enable/disable systemAppearanceChanged + */ +export let autoSystemAppearanceChanged = true; + +/** + * enable/disable systemAppearanceChanged + */ +export function setAutoSystemAppearanceChanged (value: boolean); + /** * Updates root view classes including those of modals * @param rootView the root view