[EuiHeader] Increase z-index value#8325
Conversation
…to match the intent in the inline comment
This should be either reverted or refactored/improved in order to keep it
|
I think the fix is solid now. I want to add a test. |
packages/eui/src-docs/src/views/header/header_elastic_pattern_project.tsx
Outdated
Show resolved
Hide resolved
@acstll I think this is a drawback we have to accept but I'd suggest to get an approval of design on this too. |
Definitely, I'm requesting a review from Ryan 🙏 (@ryankeairns I remember you mentioned a suggestion regarding the shadow…?) |
|
@ryankeairns I'll request a review again in a bit when this is ready-ready 😁 |
On mobile: the EuiCollapsibleNavBeta flyout is portalled, so the stacking context is determined by the overlay mask (EuiOverlayMask), making the flyouts fight each other with the same z-index (1000 from levels.maskBelowHeader) — we do nothing
|
@mgadewoll I think I addressed all pending changes 🤓 |
packages/eui/src-docs/src/views/header/header_elastic_pattern_project.tsx
Outdated
Show resolved
Hide resolved
It was meant for manual testing and debugging only
Needs a bit of investigation why it's failing on React 16 and 17
mgadewoll
left a comment
There was a problem hiding this comment.
🚢 🐈⬛ Thanks for digging into this! The solution is technically definitely the best value for impact. Let's wait for design thoughts from @ryankeairns before merging though.
|
It's hard to argue with the accessibility gain. Visually, I believe it is a bit of a downgrade but not enough to stop from proceeding. As a mitigating effort, let's decrease the size of the shadow on the header. Changing this line to ...which results in... |
@ryankeairns To confirm: we're fine changing it generally for And an additional side thought: We'll change the shadows for Borealis soon (issue) which will remove |
|
Preview staging links for this PR:
|
💚 Build Succeeded
History
cc @acstll |
Yes. (Do we differentiate the style per
🤔 Are we removing XSmall or flat? I thought it was the latter... in any case, I still feel this change - on this PR - is helpful for the interim/Amsterdam. |
|
@ryankeairns Thanks for the confirmation!
No, we don't. If we could distinguish fixed headers while a flyout is open, that might be an idea for adjusting it conditionally, but currently that's not a thing.
I thought both, but looking at the specs here again it does define |
|
@acstll I already added the change and will go ahead and merge your PR. 🚀 |
# Backport This is a manual backport of #212974 and #213292 --- `99.3.0-classic.0` ⏩ `100.0.0-classic.0` [Questions? Please see our Kibana upgrade FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams) --- ## [`v100.0.0`](https://github.com/elastic/eui/releases/v100.0.0) **Bug fixes** - Fixed `EuiComboBox` by cleaning duplicated values when having a delimiter prop. ([#8335](elastic/eui#8335)) ## [`v99.4.0`](https://github.com/elastic/eui/releases/v99.4.0) - Minor design updates to `EuiCollapsibleNavBeta` ([#8332](elastic/eui#8332)) - Allow section without a title - Second-level icons should be horizontally aligned with the top-level icon - Turn off text truncation for nav items - Added `quickSelectButtonProps` to `EuiSuperDatePicker` ([#8380](elastic/eui#8380)) **Bug fixes** - Fixed a bug in `EuiHeader` where the navigation of `EuiCollapsibleNavBeta` would render below the `EuiFlyout`'s overlay ([#8325](elastic/eui#8325)) **Accessibility** - Improved the accessibility of `EuiComboBox` by adding `aria-setsize` and `aria-posinset` to ensure correct information is provided for its virtualized listbox ([#8333](elastic/eui#8333)) - Improved the `EuiAccordionTrigger`'s screen reader UX by passed `aria-hidden` to the `EuiAccordionArrow` to avoid duplicated announcements by screen readers. ([#8342](elastic/eui#8342)) --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…nents' z-index by 1 to be on top of side nav (#236655) ## Summary This PR an issue that has been present for a few months: the side nav in Security Solution is rendered on top of the expandable flyout. This issue comes from [this change](https://github.com/elastic/eui/blob/main/packages/eui/src/components/header/header.styles.ts) introduced by [this PR](elastic/eui#8325) a few months ago in EUI. The changes suggested here are: - bump the document flyout's `z-index` from `1000` to `1001` - bump the Timeline modal's `z-index` from `1001` to `1002` - bump the timeline flyout's `z-index` from `1002` to `1003` - bump all the related flyouts' `z-index` from `1003` to `1004` Thankfully when we had made a similar change over a year ago we had marked all the related flyouts with the following comment `// EUI TODO: This z-index override of EuiOverlayMask is a workaround, and ideally should be resolved with a cleaner UI/UX flow long-term` So it was easy to find them. This is not an ideal fix (obviously it was already not an ideal fix over a year ago) but this will quickly get us back to a better UX, as currently if the flyout opens behind the side nav, users can't resize them at all because the handle to resize is hidden... | Before | After | | ------------- | ------------- | | <img width="1597" height="1062" alt="Screenshot 2025-09-26 at 3 08 50 PM" src="https://github.com/user-attachments/assets/09502b54-9120-4c9b-88e6-b956a2a3d4dd" /> | <img width="1596" height="1061" alt="Screenshot 2025-09-26 at 3 02 36 PM" src="https://github.com/user-attachments/assets/02ad729a-697e-4eeb-a632-ff29705e00cf" /> | ## What to test - make sure that the security solution flyout is always on top of the side nav - make sure that Timeline is always on top of the security solution flyout - make sure that the timeline flyout is always on top of Timeline - make sure that the flyout on the ESQL tab in Timeline behaves correctly - make sure these work after a page refresh - make sure that things work both with overlay and push modes - make sure that all secondary flyouts - accessible via the Take action button in the flyout's footer - are displayed on top. - Add to new case - Isolate host - Respond - Add endpoint exception - Add rule exception - ... - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels.
…nents' z-index by 1 to be on top of side nav (elastic#236655) ## Summary This PR an issue that has been present for a few months: the side nav in Security Solution is rendered on top of the expandable flyout. This issue comes from [this change](https://github.com/elastic/eui/blob/main/packages/eui/src/components/header/header.styles.ts) introduced by [this PR](elastic/eui#8325) a few months ago in EUI. The changes suggested here are: - bump the document flyout's `z-index` from `1000` to `1001` - bump the Timeline modal's `z-index` from `1001` to `1002` - bump the timeline flyout's `z-index` from `1002` to `1003` - bump all the related flyouts' `z-index` from `1003` to `1004` Thankfully when we had made a similar change over a year ago we had marked all the related flyouts with the following comment `// EUI TODO: This z-index override of EuiOverlayMask is a workaround, and ideally should be resolved with a cleaner UI/UX flow long-term` So it was easy to find them. This is not an ideal fix (obviously it was already not an ideal fix over a year ago) but this will quickly get us back to a better UX, as currently if the flyout opens behind the side nav, users can't resize them at all because the handle to resize is hidden... | Before | After | | ------------- | ------------- | | <img width="1597" height="1062" alt="Screenshot 2025-09-26 at 3 08 50 PM" src="https://github.com/user-attachments/assets/09502b54-9120-4c9b-88e6-b956a2a3d4dd" /> | <img width="1596" height="1061" alt="Screenshot 2025-09-26 at 3 02 36 PM" src="https://github.com/user-attachments/assets/02ad729a-697e-4eeb-a632-ff29705e00cf" /> | ## What to test - make sure that the security solution flyout is always on top of the side nav - make sure that Timeline is always on top of the security solution flyout - make sure that the timeline flyout is always on top of Timeline - make sure that the flyout on the ESQL tab in Timeline behaves correctly - make sure these work after a page refresh - make sure that things work both with overlay and push modes - make sure that all secondary flyouts - accessible via the Take action button in the flyout's footer - are displayed on top. - Add to new case - Isolate host - Respond - Add endpoint exception - Add rule exception - ... - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels.

Summary
Resolves #8206
Note
Please refer to the original issue in order to better understand the problem
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
inertattribute 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.
Thez-indexof the Header has been changed from1000to2000. 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.Only the z-index of the fixed Header has been increased by 1, leaving everything else unaffected.
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:
QA
https://eui.elastic.co/pr_8325/#/layout/header/elastic-pattern-project
Important
The example
header_elastic_pattern_project.tsxis there only for testing purposes, not meant to be merged!To test this locally
gh pr checkout 8325)yarn startin packages/euiGeneral checklist
Checked in both light and dark modesChecked in mobileChecked in Chrome, Safari, Edge, and Firefoxscreenreader modesAdded documentationProps have proper autodocs (using@defaultif default values are missing) and playground togglesChecked Code Sandbox works for any docs examplesUpdated visual regression testsIf applicable, added the breaking change issue label (and filled out the breaking change checklist)If applicable, file an issue to update EUI's Figma library with any corresponding UI changes. (This is an internal repo, if you are external to Elastic, ask a maintainer to submit this request)