From 4c7b1a739701810806695853b9a793769f519a85 Mon Sep 17 00:00:00 2001 From: Alexey Volkov Date: Sun, 22 Nov 2020 00:25:03 +0200 Subject: [PATCH 1/3] [EuiCheckbox] fix inputRef prop on input element Fixes the following warning: "React does not recognize the `inputRef` prop on a DOM element." --- src/components/form/checkbox/checkbox.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/form/checkbox/checkbox.tsx b/src/components/form/checkbox/checkbox.tsx index 236777dd1c3..c2c16c4d944 100644 --- a/src/components/form/checkbox/checkbox.tsx +++ b/src/components/form/checkbox/checkbox.tsx @@ -83,7 +83,7 @@ export class EuiCheckbox extends Component { ...rest } = this.props; - const { indeterminate, ...inputProps } = rest; // `indeterminate` is set dynamically later + const { indeterminate, inputRef, ...inputProps } = rest; // `indeterminate` and `inputRef` are set dynamically later const classes = classNames( 'euiCheckbox', From f99cc01e95367f05506e37523b0b4c8375d78d3b Mon Sep 17 00:00:00 2001 From: rosko Date: Wed, 9 Dec 2020 15:00:30 +0200 Subject: [PATCH 2/3] [EuiCheckbox] fix inputRef prop on input element Fixes the following warning: "React does not recognize the `inputRef` prop on a DOM element." --- CHANGELOG.md | 1 + src/components/form/checkbox/checkbox.tsx | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index af8233bfa9b..74f2a8e9b17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ **Bug fixes** - Fixed initial focus of an `EuiButtonGroup` when first item in a popover ([#4288](https://github.com/elastic/eui/pull/4288)) +- Fixed `inputRef` for `EuiCheckbox` ([#4298](https://github.com/elastic/eui/pull/4298)) **Theme: Amsterdam** diff --git a/src/components/form/checkbox/checkbox.tsx b/src/components/form/checkbox/checkbox.tsx index c2c16c4d944..ded6d3f0df7 100644 --- a/src/components/form/checkbox/checkbox.tsx +++ b/src/components/form/checkbox/checkbox.tsx @@ -80,11 +80,11 @@ export class EuiCheckbox extends Component { type, disabled, compressed, + indeterminate, + inputRef, ...rest } = this.props; - const { indeterminate, inputRef, ...inputProps } = rest; // `indeterminate` and `inputRef` are set dynamically later - const classes = classNames( 'euiCheckbox', type && typeToClassNameMap[type], @@ -115,7 +115,7 @@ export class EuiCheckbox extends Component { onChange={onChange} disabled={disabled} ref={this.setInputRef} - {...inputProps} + {...rest} />
From 2ddb91c3a8789f5d7cae4c07dd74bb8311891329 Mon Sep 17 00:00:00 2001 From: rosko Date: Wed, 9 Dec 2020 15:07:15 +0200 Subject: [PATCH 3/3] [EuiCheckbox] fix inputRef prop on input element Fixes the following warning: "React does not recognize the `inputRef` prop on a DOM element." --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7739225ab9..1ad47f63526 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ - Added `!default` to SASS variables of `EuiCollapsibleNav` ([#4335](https://github.com/elastic/eui/pull/4335)) - 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 `inputRef` for `EuiCheckbox` ([#4298](https://github.com/elastic/eui/pull/4298)) **Theme: Amsterdam**