From 9688f4d42f3d1eae0a98b7e6fee6cc732e57e807 Mon Sep 17 00:00:00 2001 From: Manu MA Date: Wed, 2 Oct 2019 23:13:27 +0200 Subject: [PATCH] refactor(menu): deprecate main html attribute (#19237) --- core/src/components/menu/menu.tsx | 11 +++++++++++ core/src/components/split-pane/split-pane.tsx | 18 ++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/core/src/components/menu/menu.tsx b/core/src/components/menu/menu.tsx index 6db7450c192..6bc05d315e6 100644 --- a/core/src/components/menu/menu.tsx +++ b/core/src/components/menu/menu.tsx @@ -148,6 +148,17 @@ export class Menu implements ComponentInterface, MenuI { const el = this.el; const parent = el.parentNode as any; + if (this.contentId === undefined) { + console.warn(`[DEPRECATED][ion-menu] Using the [main] attribute is deprecated, please use the "contentId" property instead: +BEFORE: + ... +
...
+ +AFTER: + +
...
+`); + } const content = this.contentId !== undefined ? document.getElementById(this.contentId) : parent && parent.querySelector && parent.querySelector('[main]'); diff --git a/core/src/components/split-pane/split-pane.tsx b/core/src/components/split-pane/split-pane.tsx index ff2dd3b99b8..744a4625cf7 100644 --- a/core/src/components/split-pane/split-pane.tsx +++ b/core/src/components/split-pane/split-pane.tsx @@ -69,6 +69,24 @@ export class SplitPane implements ComponentInterface { } } + componentWillLoad() { + if (this.contentId === undefined) { + console.warn(`[DEPRECATED][ion-split-pane] Using the [main] attribute is deprecated, please use the "contentId" property instead: +BEFORE: + + ... +
...
+
+ +AFTER: + + ... +
...
+
+`); + } + } + @Watch('disabled') @Watch('when') protected updateState() {