diff --git a/src/components/flyout/flyout.spec.tsx b/src/components/flyout/flyout.spec.tsx
index b041db9d5dc..71d293b3f4f 100644
--- a/src/components/flyout/flyout.spec.tsx
+++ b/src/components/flyout/flyout.spec.tsx
@@ -62,6 +62,19 @@ describe('EuiFlyout', () => {
'euiFlyoutCloseButton'
);
});
+
+ it('does not focus trap or scrollLock for push flyouts', () => {
+ cy.mount(
+ <>
+
Body scroll
+
+ >
+ );
+
+ cy.get('body').realClick({ position: 'topLeft' }).realPress('End'); // TODO: Use cypress-real-event's `realMouseWheel` API, whenever they release it
+ cy.wait(500); // Wait a tick to let scroll position update
+ cy.window().its('scrollY').should('not.equal', 0);
+ });
});
describe('Close behavior: standard', () => {
diff --git a/src/components/flyout/flyout.tsx b/src/components/flyout/flyout.tsx
index e5f675d5ec9..af06a2cea3d 100644
--- a/src/components/flyout/flyout.tsx
+++ b/src/components/flyout/flyout.tsx
@@ -405,7 +405,7 @@ export const EuiFlyout = forwardRef(
let flyout = (
{
cy.window().its('scrollY').should('not.equal', 0);
});
+ it('does not scrollLock if the focus trap is disabled', () => {
+ cy.realMount(
+
+
+ Test
+
+
+ );
+
+ scrollSelector('body');
+ cy.window().its('scrollY').should('not.equal', 0);
+ });
+
it('prevents scrolling on the page body', () => {
cy.realMount(
diff --git a/src/components/focus_trap/focus_trap.tsx b/src/components/focus_trap/focus_trap.tsx
index c08c258802f..2d2fe5be5f4 100644
--- a/src/components/focus_trap/focus_trap.tsx
+++ b/src/components/focus_trap/focus_trap.tsx
@@ -146,7 +146,7 @@ export class EuiFocusTrap extends Component {
return (
{children}
- {scrollLock && }
+ {!isDisabled && scrollLock && }
);
}
diff --git a/upcoming_changelogs/6764.md b/upcoming_changelogs/6764.md
new file mode 100644
index 00000000000..f85d5d5aa9b
--- /dev/null
+++ b/upcoming_changelogs/6764.md
@@ -0,0 +1,3 @@
+**Bug fixes**
+
+- Fixed broken push `EuiFlyout` behavior