From ac4f254a4f761478b7c97ba08d151c361b9dcd5a Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Wed, 2 Oct 2019 10:42:53 -0400 Subject: [PATCH] refactor(): remove [main] from split-pane (#19511) --- core/src/components.d.ts | 4 ++-- core/src/components/split-pane/readme.md | 10 +++++----- core/src/components/split-pane/split-pane.tsx | 4 +--- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/core/src/components.d.ts b/core/src/components.d.ts index 0ea0da2563..7cb1da1cd6 100644 --- a/core/src/components.d.ts +++ b/core/src/components.d.ts @@ -2457,7 +2457,7 @@ export namespace Components { } interface IonSplitPane { /** - * The content `id` of the split-pane's main content. This property can be used instead of the `[main]` attribute to select the `main` content of the split-pane. + * The content `id` of the split-pane's main content. */ 'contentId'?: string; /** @@ -5706,7 +5706,7 @@ declare namespace LocalJSX { } interface IonSplitPane { /** - * The content `id` of the split-pane's main content. This property can be used instead of the `[main]` attribute to select the `main` content of the split-pane. + * The content `id` of the split-pane's main content. */ 'contentId'?: string; /** diff --git a/core/src/components/split-pane/readme.md b/core/src/components/split-pane/readme.md index ac589c584e..19fdcc0eed 100644 --- a/core/src/components/split-pane/readme.md +++ b/core/src/components/split-pane/readme.md @@ -133,11 +133,11 @@ export const SplitPlaneExample: React.SFC<{}> = () => ( ## Properties -| Property | Attribute | Description | Type | Default | -| ----------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | ------------- | -| `contentId` | `content-id` | The content `id` of the split-pane's main content. This property can be used instead of the `[main]` attribute to select the `main` content of the split-pane. | `string \| undefined` | `undefined` | -| `disabled` | `disabled` | If `true`, the split pane will be hidden. | `boolean` | `false` | -| `when` | `when` | When the split-pane should be shown. Can be a CSS media query expression, or a shortcut expression. Can also be a boolean expression. | `boolean \| string` | `QUERY['lg']` | +| Property | Attribute | Description | Type | Default | +| ----------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | ------------- | +| `contentId` | `content-id` | The content `id` of the split-pane's main content. | `string \| undefined` | `undefined` | +| `disabled` | `disabled` | If `true`, the split pane will be hidden. | `boolean` | `false` | +| `when` | `when` | When the split-pane should be shown. Can be a CSS media query expression, or a shortcut expression. Can also be a boolean expression. | `boolean \| string` | `QUERY['lg']` | ## Events diff --git a/core/src/components/split-pane/split-pane.tsx b/core/src/components/split-pane/split-pane.tsx index 744a4625cf..81171d55da 100644 --- a/core/src/components/split-pane/split-pane.tsx +++ b/core/src/components/split-pane/split-pane.tsx @@ -29,8 +29,6 @@ export class SplitPane implements ComponentInterface { /** * The content `id` of the split-pane's main content. - * This property can be used instead of the `[main]` attribute to select the `main` - * content of the split-pane. */ @Prop() contentId?: string; @@ -151,7 +149,7 @@ AFTER: let foundMain = false; for (let i = 0; i < nu; i++) { const child = children[i] as HTMLElement; - const isMain = contentId !== undefined ? child.id === contentId : child.hasAttribute('main'); + const isMain = contentId !== undefined && child.id === contentId; if (isMain) { if (foundMain) { console.warn('split pane cannot have more than one main node');