Skip to content

Commit 9688f4d

Browse files
manucorporatbrandyscarney
authored andcommitted
refactor(menu): deprecate main html attribute (ionic-team#19237)
1 parent f4818a1 commit 9688f4d

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

core/src/components/menu/menu.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,17 @@ export class Menu implements ComponentInterface, MenuI {
148148

149149
const el = this.el;
150150
const parent = el.parentNode as any;
151+
if (this.contentId === undefined) {
152+
console.warn(`[DEPRECATED][ion-menu] Using the [main] attribute is deprecated, please use the "contentId" property instead:
153+
BEFORE:
154+
<ion-menu>...</ion-menu>
155+
<div main>...</div>
156+
157+
AFTER:
158+
<ion-menu contentId="my-content"></ion-menu>
159+
<div id="my-content">...</div>
160+
`);
161+
}
151162
const content = this.contentId !== undefined
152163
? document.getElementById(this.contentId)
153164
: parent && parent.querySelector && parent.querySelector('[main]');

core/src/components/split-pane/split-pane.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,24 @@ export class SplitPane implements ComponentInterface {
6969
}
7070
}
7171

72+
componentWillLoad() {
73+
if (this.contentId === undefined) {
74+
console.warn(`[DEPRECATED][ion-split-pane] Using the [main] attribute is deprecated, please use the "contentId" property instead:
75+
BEFORE:
76+
<ion-split-pane>
77+
...
78+
<div main>...</div>
79+
</ion-split-pane>
80+
81+
AFTER:
82+
<ion-split-pane contentId="main-content">
83+
...
84+
<div id="main-content">...</div>
85+
</ion-split-pane>
86+
`);
87+
}
88+
}
89+
7290
@Watch('disabled')
7391
@Watch('when')
7492
protected updateState() {

0 commit comments

Comments
 (0)