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

[EuiFlyout] Preserve scrollbar width on body when EuiFlyout is open #6645

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
2 changes: 1 addition & 1 deletion src/components/code/code_block_full_screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export const EuiCodeBlockFullScreenWrapper: FunctionComponent = ({

return (
<EuiOverlayMask>
<EuiFocusTrap clickOutsideDisables={true}>
<EuiFocusTrap scrollLock preventScrollOnFocus clickOutsideDisables={true}>
<div className="euiCodeBlockFullScreen" css={cssStyles}>
{children}
</div>
Expand Down
1 change: 1 addition & 0 deletions src/components/flyout/flyout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ export const EuiFlyout = forwardRef(
let flyout = (
<EuiFocusTrap
disabled={isPushed}
scrollLock={ownFocus}
clickOutsideDisables={!ownFocus}
onClickOutside={onClickOutside}
{...focusTrapProps}
Expand Down
6 changes: 5 additions & 1 deletion src/components/image/image_fullscreen_wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ export const EuiImageFullScreenWrapper: FunctionComponent<EuiImageWrapperProps>

return (
<EuiOverlayMask data-test-subj="fullScreenOverlayMask">
<EuiFocusTrap onClickOutside={closeFullScreen}>
<EuiFocusTrap
scrollLock
preventScrollOnFocus
onClickOutside={closeFullScreen}
>
<>
<figure
aria-label={optionalCaptionText}
Expand Down
5 changes: 5 additions & 0 deletions upcoming_changelogs/6645.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
**Bug fixes**

- Fixed `EuiFlyout` to preserve body scrollbar width on open
- Fixed `EuiImage`'s full screen mode to not scroll jump & to preserve body scrollbar width on open
- Fixed `EuiCodeBlock`'s full screen mode to not scroll jump & to preserve body scrollbar width on open