[Discover] Fix app menu focus when closing background search flyout#250332
Merged
davismcphee merged 1 commit intoelastic:mainfrom Jan 26, 2026
Merged
Conversation
Contributor
|
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
AlexGPlay
reviewed
Jan 26, 2026
Comment on lines
88
to
-95
|
|
||
| describe('when the header close button is clicked', () => { | ||
| it('calls the onClose callback', async () => { | ||
| const { onClose, user } = setup(); | ||
| const closeButton = screen.getByLabelText('Close this dialog'); | ||
| await user.click(closeButton); | ||
| expect(onClose).toHaveBeenCalled(); | ||
| }); | ||
| }); |
Contributor
There was a problem hiding this comment.
we should be able to keep this test if we still have the close button on the top right
Contributor
Author
There was a problem hiding this comment.
The top right close button is now handled through coreStart.overlays.openFlyout and doesn't appear when rendering Flyout directly, so I wasn't sure how to preserve this test. I'm going to merge this PR to get the fix in, but I can open a follow up to restore this test if you have suggestions how.
AlexGPlay
approved these changes
Jan 26, 2026
Contributor
AlexGPlay
left a comment
There was a problem hiding this comment.
other than the removed test lgtm - thank you for fixing it 🙇🏻
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
Noticed while testing #246156. It looks like closing the background search flyout in Discover doesn't return focus to the correct app menu button. This PR fixes that.
It also fixes an issue where
EuiFlyoutwas rendered twice for the background search flyout (caused by passing anotherEuiFlyoutintocoreStart.overlays.openFlyout). Afaict this didn't actually affect any functionality other than displaying a duplicate flyout backdrop overlay, but made theonClosecallback misbehave, so I fixed it.Checklist
release_note:breakinglabel should be applied in these situations.release_note:*label is applied per the guidelinesbackport:*labels.