Repository navigation
[EuiFilePicker] Fix missing removeFiles reference - #9930
Merged
mgadewoll merged 4 commits intoAug 19, 2026
Merged
Conversation
- closes migration gap with Kibana usages
mgadewoll
force-pushed
the
filepicker/add-ref-remove-files
branch
from
August 19, 2026 09:23
86491ce to
3fc0304
Compare
weronikaolejniczak
approved these changes
Aug 19, 2026
mgadewoll
force-pushed
the
filepicker/add-ref-remove-files
branch
from
August 19, 2026 09:55
3fc0304 to
dddeb3c
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR restores imperative ref support on EuiFilePicker by converting the component to forwardRef and exposing a typed imperative handle (removeFiles() plus the underlying input element), closing a functional gap introduced in the earlier class-to-function migration.
Changes:
- Convert
EuiFilePickertoforwardRefand exposeremoveFiles()+inputviauseImperativeHandle. - Export the new
EuiFilePickerReftype from the component entrypoint. - Add Jest coverage to verify the new ref API works as expected.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/release-cli/kibana-prep-commits | Adds Kibana commit URLs for integration/staging. |
| packages/eui/src/components/form/file_picker/index.ts | Re-exports EuiFilePickerRef from the package entrypoint. |
| packages/eui/src/components/form/file_picker/file_picker.tsx | Implements forwardRef + useImperativeHandle to expose removeFiles() and input. |
| packages/eui/src/components/form/file_picker/file_picker.test.tsx | Adds tests asserting the new ref API exists and removeFiles() clears state + calls onChange(null). |
| packages/eui/changelogs/upcoming/9930.md | Adds a changelog entry documenting the restored imperative ref support. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
💚 Build Succeeded
History
cc @mgadewoll |
💚 Build Succeeded
History
cc @mgadewoll |
mgadewoll
added a commit
to elastic/kibana
that referenced
this pull request
Aug 28, 2026
## Dependency updates `@elastic/eui` - 119.0.0 ⏩ 119.1.0 `@elastic/eui-test-helpers` - 1.3.0 ⏩ 1.4.0 ## Changes - Updated usages of `EuiFilePickerClass` to `EuiFilePickerRef` after the migration of `EuiFilePicker` from class to function component ## Package updates ### `@elastic/eui` [v119.1.0](https://github.com/elastic/eui/blob/main/packages/eui/changelogs/CHANGELOG_2026.md) - Updated `EuiFlyoutMenu` action icon spacing: `leadingActions` and `trailingActions` icons are now grouped with a consistent gap between each icon ([#9887](elastic/eui#9887)) - Updated `EuiFlyoutMenu` back button to show a tooltip with the previous page title (e.g. "Back to Page 1") when history context is available ([#9887](elastic/eui#9887)) - Added `cursorDefault`, `logIn`, and `routeSplit` glyphs to `EuiIcon` ([#9885](elastic/eui#9885)) - Updated `EuiSplitButton` to apply redesign style changes ([#9865](elastic/eui#9865)) - Added a development warning to `useGeneratedHtmlId` and `htmlIdGenerator` when the passed `prefix`/`suffix` contains whitespace, which generates invalid HTML IDs ([#9868](elastic/eui#9868)) - Updated `EuiButtonGroup`: ([#9862](elastic/eui#9862)) - Added `variant="segmented"` which renders the group as visually connected control group - Added `showDividers` prop to optionally render dividers between group children - Added `layout` prop to optionally render icon button groups vertically - Added `wrap` prop to manually control the group wrapping behavior **Bug fixes** - Fixed `EuiDataGrid` header cell actions popover not opening when pressing Enter on a focused actions button ([#9931](elastic/eui#9931)) - Fixed `EuiFilePicker` losing imperative `ref` support when migrated from class to function component ([#9879](elastic/eui#9879)). Use `useRef<EuiFilePickerRef>()` where `useRef<EuiFilePickerClass>()` was previously used. ([#9930](elastic/eui#9930)) - Fixed `EuiSplitButton` having a wrong `inline-size` when `textProps={false}` is set on an action button that has `iconType` ([#9917](elastic/eui#9917)) ### `@elastic/eui-test-helpers` [v1.4.0](https://github.com/elastic/eui/blob/main/packages/test-helpers/changelogs/CHANGELOG_2026.md) - Added `EuiSelectableObject` with `options`, `selectOption(label)` and `search(term)` ([#9908](elastic/eui#9908)) --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Hannah Mudge <[email protected]>
dej611
pushed a commit
to dej611/kibana
that referenced
this pull request
Aug 31, 2026
## Dependency updates `@elastic/eui` - 119.0.0 ⏩ 119.1.0 `@elastic/eui-test-helpers` - 1.3.0 ⏩ 1.4.0 ## Changes - Updated usages of `EuiFilePickerClass` to `EuiFilePickerRef` after the migration of `EuiFilePicker` from class to function component ## Package updates ### `@elastic/eui` [v119.1.0](https://github.com/elastic/eui/blob/main/packages/eui/changelogs/CHANGELOG_2026.md) - Updated `EuiFlyoutMenu` action icon spacing: `leadingActions` and `trailingActions` icons are now grouped with a consistent gap between each icon ([elastic#9887](elastic/eui#9887)) - Updated `EuiFlyoutMenu` back button to show a tooltip with the previous page title (e.g. "Back to Page 1") when history context is available ([elastic#9887](elastic/eui#9887)) - Added `cursorDefault`, `logIn`, and `routeSplit` glyphs to `EuiIcon` ([elastic#9885](elastic/eui#9885)) - Updated `EuiSplitButton` to apply redesign style changes ([elastic#9865](elastic/eui#9865)) - Added a development warning to `useGeneratedHtmlId` and `htmlIdGenerator` when the passed `prefix`/`suffix` contains whitespace, which generates invalid HTML IDs ([elastic#9868](elastic/eui#9868)) - Updated `EuiButtonGroup`: ([elastic#9862](elastic/eui#9862)) - Added `variant="segmented"` which renders the group as visually connected control group - Added `showDividers` prop to optionally render dividers between group children - Added `layout` prop to optionally render icon button groups vertically - Added `wrap` prop to manually control the group wrapping behavior **Bug fixes** - Fixed `EuiDataGrid` header cell actions popover not opening when pressing Enter on a focused actions button ([elastic#9931](elastic/eui#9931)) - Fixed `EuiFilePicker` losing imperative `ref` support when migrated from class to function component ([elastic#9879](elastic/eui#9879)). Use `useRef<EuiFilePickerRef>()` where `useRef<EuiFilePickerClass>()` was previously used. ([elastic#9930](elastic/eui#9930)) - Fixed `EuiSplitButton` having a wrong `inline-size` when `textProps={false}` is set on an action button that has `iconType` ([elastic#9917](elastic/eui#9917)) ### `@elastic/eui-test-helpers` [v1.4.0](https://github.com/elastic/eui/blob/main/packages/test-helpers/changelogs/CHANGELOG_2026.md) - Added `EuiSelectableObject` with `options`, `selectOption(label)` and `search(term)` ([elastic#9908](elastic/eui#9908)) --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Hannah Mudge <[email protected]>
weronikaolejniczak
pushed a commit
to boriskirov/eui
that referenced
this pull request
Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
forwardRef+useImperativeHandletoEuiFilePicker, exposingremoveFiles().EuiFilePickerClassclass component natively allowed consumers to attach arefand callref.current.removeFiles()to programmatically clear the picker after a file was processed. This was not migrated in the migration PR and caused a functionality gap in Kibana usages.React.forwardRef<EuiFilePickerRef, EuiFilePickerProps>and addeduseImperativeHandleto expose the existingremoveFilescallback for consumers.ref.current.inputas wellAPI Changes
EuiFilePickerrefrefasEuiFilePickerRefcontainingremoveFilesandinputScreenshots
Impact Assessment
Note: Most PRs should be tested in Kibana to help gauge their Impact before merging.
Impact level: 🟢 Low
Requires Kibana changes: commits added here
🧪 The changes have been run in Kibana CI (🟢 build)
Release Readiness
Documentation: {link to docs page(s)}Figma: {link to Figma or issue}Migration guide: {steps or link, for breaking/visual changes or deprecations}Adoption plan (new features): {link to issue/doc or outline who will integrate this and where}QA instructions for reviewer
removeFilesis available and works as expected (to clear the internal input)inputreturns the correct HTML element (input element)Checklist before marking Ready for Review
breaking changelabel (if applicable)Reviewer checklist