-
Notifications
You must be signed in to change notification settings - Fork 842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢 🐈⬛ 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. 🚀 |
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
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.
Thez-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.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.tsx
is there only for testing purposes, not meant to be merged!To test this locally
gh pr checkout 8325
)yarn start
in packages/euiGeneral checklist
Checked in both light and dark modesChecked in mobileChecked in Chrome, Safari, Edge, and Firefoxscreenreader modesAdded documentationProps have proper autodocs (using@default
if 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)