Skip to content

Commit 070a434

Browse files
author
Tanner Reits
committed
feat: add appRootClass option to global config
1 parent 03c4afc commit 070a434

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

core/src/utils/config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ export interface IonicConfig {
108108
*/
109109
toastDuration?: number;
110110

111+
appRootClass?: string;
112+
111113
/**
112114
* Overrides the default "animation" of all `ion-nav` and `ion-router-outlet` across the whole application.
113115
* This prop allows to replace the default transition and provide a custom one that applies to all navigation outlets.

core/src/utils/framework-delegate.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { config } from '../global/config';
12
import type { ComponentRef, FrameworkDelegate } from '../interface';
23

34
import { componentOnReady } from './helpers';
@@ -128,7 +129,8 @@ export const CoreDelegate = () => {
128129
* Get the root of the app and
129130
* add the overlay there.
130131
*/
131-
const app = document.querySelector('ion-app, .ion-app') || document.body;
132+
const appRootClass = config.get('appRootClass', 'ion-app');
133+
const app = document.querySelector(`ion-app, ${appRootClass}`) || document.body;
132134

133135
/**
134136
* Create a placeholder comment so that

0 commit comments

Comments
 (0)