[EuiHeader] Increase z-index value #8325
Draft
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
Resolves #8206
Note
Please refer to the original issue in order to better understand the problem
Important
I'm marking this as Draft because it needs to be manually tested first and some discussion needs to happen
To summarize the problem: in a Project View in Kibana (e.g. Serverless) when a Flyout is open, the navigation in Collapsible Nav Beta is reachable via keyboard, even though it stands behind the Flyout's overlay (screenshot).
We have evaluated more than one way to solve the issue. Most of them have problems. The one presented here feels like the least fragile (it
won'tshouldn't create other problems down the road) and the least complex.Instead of excluding the navigation from the focusable elements in the Header (e.g. adding the
inert
attribute to it while the Flyout is open) —as suggested in the original issue—, this PR goes a different way: it brings the navigation up above, on top of the Flyout's overlay, so it's OK for it to be focusable.It's also worth mentioning that this is the way the Classic view works: if you toggle the navigation open with a Flyout open, it goes on top of the overlay and it's reachable.
The
z-index
of the Header has been changed from1000
to2000
. But it remains below everything else (e.g. modals) it was below before. The relationship between the Header's z-index and other components whose z-index is relative to it, remains the same. Only the z-index relationship between Header and Flyout is changed.Here's a recording demoing the idea
Screen.Recording.2025-02-12.at.22.43.59.z-index.mov
The one remarkable side-effect, and at first glance the only, of the change is the Header's shadow appearing over the Flyout (screenshot below).
Shadow appearing:
(there's an alternative, much simpler, implementation where only the value of the "fixed" header is increased by 1, all tests still pass, but I think it changes a lot more relationships between components, so unexpected results may occur…)
QA
https://eui.elastic.co/pr_8325/#/layout/header/elastic-pattern-project
To test this locally
gh pr checkout 8325
)yarn start
in packages/euiGeneral checklist
Props have proper autodocs (using@default
if default values are missing) and playground togglesChecked Code Sandbox works for any docs examplesUpdated visual regression tests