Skip to content

Commit

Permalink
[EuiCheckbox] fix inputRef prop on input element (#4298)
Browse files Browse the repository at this point in the history
* [EuiCheckbox] fix inputRef prop on input element

Fixes the following warning: "React does not recognize the `inputRef` prop on a DOM element."

* [EuiCheckbox] fix inputRef prop on input element

Fixes the following warning: "React does not recognize the `inputRef` prop on a DOM element."

* [EuiCheckbox] fix inputRef prop on input element

Fixes the following warning: "React does not recognize the `inputRef` prop on a DOM element."

Co-authored-by: Greg Thompson <[email protected]>
  • Loading branch information
rosko and thompsongl authored Dec 9, 2020
1 parent a019e8c commit 90a0280
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- Fixed `EuiDataGrid` column property `displayAsText`. Column headers prefer `displayAsText` over `id`; `display` still takes precedence. If provided, the filter in the sort-popover will search against `displayAsText` instead of `id`. ([#4351](https://github.com/elastic/eui/pull/4351))
- Fixed propagation of `esc` key presses closing parent popovers ([#4336](https://github.com/elastic/eui/pull/4336))
- Fixed overwritten `isDisabled` prop on `EuiListGroupItem` `extraAction` config ([#4359](https://github.com/elastic/eui/pull/4359))

- Fixed `inputRef` for `EuiCheckbox` ([#4298](https://github.com/elastic/eui/pull/4298))

**Theme: Amsterdam**

Expand Down
6 changes: 3 additions & 3 deletions src/components/form/checkbox/checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ export class EuiCheckbox extends Component<EuiCheckboxProps> {
type,
disabled,
compressed,
indeterminate,
inputRef,
...rest
} = this.props;

const { indeterminate, ...inputProps } = rest; // `indeterminate` is set dynamically later

const classes = classNames(
'euiCheckbox',
type && typeToClassNameMap[type],
Expand Down Expand Up @@ -115,7 +115,7 @@ export class EuiCheckbox extends Component<EuiCheckboxProps> {
onChange={onChange}
disabled={disabled}
ref={this.setInputRef}
{...inputProps}
{...rest}
/>

<div className="euiCheckbox__square" />
Expand Down

0 comments on commit 90a0280

Please sign in to comment.