Skip to content
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

[EUI] Add scrollLock workaround CSS to Kibana's body #153227

Merged
merged 3 commits into from
Mar 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/core/public/styles/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,12 @@
.euiPageHeader--bottomBorder:not(.euiPageHeader--tabsAtBottom):not([class*='euiPageHeader--padding']) {
padding-bottom: $euiSizeL;
}

// Kibana's body ignores the `margin-right !important` set by react-remove-scroll-bar
// (used by EUI's focus trap component & prevents page width jumps on full-screen overlays)
// due to the 100% width/min-width CSS set by Kibana in other places. To work around this, we
// grab the `--removed-body-scroll-bar-size` var added by the library & manually set `padding`
// TODO: Use `gapMode` instead once https://github.com/theKashey/react-focus-on/issues/65 is fixed
.kbnBody {
padding-right: var(--removed-body-scroll-bar-size, 0);
}
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ export class CustomizePanelAction implements Action<CustomizePanelActionContext>
{
size: 's',
'data-test-subj': 'customizePanel',
// @ts-ignore - TODO: Remove this once https://github.com/elastic/eui/pull/6645 lands in Kibana
focusTrapProps: { scrollLock: true },
}
);
overlayTracker?.openOverlay(handle);
Expand Down