Skip to content

Commit

Permalink
refactor(): remove [main] from split-pane (#19511)
Browse files Browse the repository at this point in the history
  • Loading branch information
liamdebeasi authored and brandyscarney committed Oct 8, 2019
1 parent 83d3782 commit 964730d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions core/src/components.d.ts
Expand Up @@ -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;
/**
Expand Down Expand Up @@ -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;
/**
Expand Down
10 changes: 5 additions & 5 deletions core/src/components/split-pane/readme.md
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions core/src/components/split-pane/split-pane.tsx
Expand Up @@ -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;

Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 964730d

Please sign in to comment.