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

Fixes bug in the EuiCheckboxGroup demo page and add disabled to TS defs #2545

Merged
merged 3 commits into from
Nov 19, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## [`master`](https://github.com/elastic/eui/tree/master)

- Added `badge` prop and new styles `EuiHeaderAlert` ([#2506](https://github.com/elastic/eui/pull/2506))
- Added `disabled` prop to the `EuiCheckboxGroup` definition ([#2545](https://github.com/elastic/eui/pull/2545))

## [`16.0.1`](https://github.com/elastic/eui/tree/v16.0.1)

Expand Down
11 changes: 9 additions & 2 deletions src-docs/src/views/form_controls/checkbox_group.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,17 @@ export default class extends Component {
},
];

this.checkboxesDisabled = this.checkboxes.map(checkbox => {
return { ...checkbox, id: `${checkbox.id}_disabled` };
});

this.state = {
checkboxIdToSelectedMap: {
[`${idPrefix}1`]: true,
},
checkboxIdToSelectedMapDisabled: {
[`${idPrefix}1_disabled`]: true,
},
};
}

Expand Down Expand Up @@ -67,8 +74,8 @@ export default class extends Component {
<EuiSpacer size="s" />

<EuiCheckboxGroup
options={this.checkboxes}
idToSelectedMap={this.state.checkboxIdToSelectedMap}
options={this.checkboxesDisabled}
idToSelectedMap={this.state.checkboxIdToSelectedMapDisabled}
onChange={this.onChange}
disabled
/>
Expand Down
1 change: 1 addition & 0 deletions src/components/form/checkbox/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ declare module '@elastic/eui' {
idToSelectedMap: EuiCheckboxGroupIdToSelectedMap;
onChange: ChangeEventHandler<HTMLInputElement>;
compressed?: boolean;
disabled?: boolean;
}

export const EuiCheckboxGroup: FunctionComponent<
Expand Down