Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(): remove [main] from split-pane #19511

Merged
merged 1 commit into from Oct 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -133,7 +131,7 @@ export class SplitPane implements ComponentInterface {
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