From 036a89c46e4e05923491b62b1e51d361ca08d0ec Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Thu, 12 Aug 2021 10:07:07 -0500 Subject: [PATCH] [EuiFormRow] Respect child `isDisabled` (#5022) * respect isDisabled * CL --- CHANGELOG.md | 1 + src/components/form/form_row/form_row.tsx | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6970e29a4e..2846cda8e63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ **Bug fixes** - Fixed usage of `outsideClickCloses` prop of `EuiFlyout` ([#4986](https://github.com/elastic/eui/pull/4986)) +- Fixed `EuiFormRow` ignoring `isDisabled` prop on the child element. ([#5022](https://github.com/elastic/eui/pull/5022)) ## [`37.1.0`](https://github.com/elastic/eui/tree/v37.1.0) diff --git a/src/components/form/form_row/form_row.tsx b/src/components/form/form_row/form_row.tsx index 4650fb27f67..428280f4050 100644 --- a/src/components/form/form_row/form_row.tsx +++ b/src/components/form/form_row/form_row.tsx @@ -271,8 +271,8 @@ export class EuiFormRow extends Component { const child = Children.only(children); const field = cloneElement(child, { id, - // Allow the child's disabled prop to supercede the `isDisabled` - disabled: child.props.disabled ?? isDisabled, + // Allow the child's disabled or isDisabled prop to supercede the `isDisabled` + disabled: child.props.disabled ?? child.props.isDisabled ?? isDisabled, onFocus: this.onFocus, onBlur: this.onBlur, ...optionalProps,