From 966bb883727159569293e41d1f899bb5a497158c Mon Sep 17 00:00:00 2001 From: Andy Young Date: Fri, 4 Feb 2022 09:37:02 -0800 Subject: [PATCH] [EuiFilePicker] Fix can still be cleared when disabled (#5603) * Pass disabled prop down to buttons in EuiFilePicker * Add EuiFilePicker bugfix to changelog * Don't display remove buttons at all when EuiFilePicker is disabled --- CHANGELOG.md | 1 + src/components/form/file_picker/file_picker.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0150fcadd80..105d8624141 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ **Bug fixes** - Fixed `EuiInMemoryTable`'s `onTableChange` callback not returning the correct `sort.field` value on pagination ([#5588](https://github.com/elastic/eui/pull/5588)) +- Fixed `EuiFilePicker` allowing files to be removed when `disabled` ([#5603](https://github.com/elastic/eui/pull/5603)) ## [`46.2.0`](https://github.com/elastic/eui/tree/v46.2.0) diff --git a/src/components/form/file_picker/file_picker.tsx b/src/components/form/file_picker/file_picker.tsx index 8f8452cde6c..6fe56f6f16c 100644 --- a/src/components/form/file_picker/file_picker.tsx +++ b/src/components/form/file_picker/file_picker.tsx @@ -175,7 +175,7 @@ export class EuiFilePicker extends Component { clearButton = ( ); - } else if (isOverridingInitialPrompt) { + } else if (isOverridingInitialPrompt && !disabled) { if (normalFormControl) { clearButton = (