+
+
);
const maskWithClick = (
-
+ {
changeMaskWithClick(false);
@@ -39,16 +42,16 @@ export default () => {
return (
+ changeMaskWithClick(true)}>
+ Overlay with button
+
+ {
changeMask(true);
}}
>
- Overlay with onClick
-
-
- changeMaskWithClick(true)}>
- Overlay with button
+ Overlay with EuiFocusTrap click-to-close
{maskOpen ? modal : undefined}
{maskWithClickOpen ? maskWithClick : undefined}
diff --git a/src-docs/src/views/overlay_mask/overlay_mask_example.js b/src-docs/src/views/overlay_mask/overlay_mask_example.js
index ef6a91a4db5..48bd4220216 100644
--- a/src-docs/src/views/overlay_mask/overlay_mask_example.js
+++ b/src-docs/src/views/overlay_mask/overlay_mask_example.js
@@ -39,8 +39,11 @@ export const OverlayMaskExample = {
{' '}
to make before choosing to use an overlay. At the very least, you
must provide a visible button to close the overlay. You can also
- pass an onClick handler to handle closing the
- overlay.
+ nest an{' '}
+
+ EuiFocusTrap
+ {' '}
+ to handle closing the overlay.
>
),
diff --git a/src-docs/src/views/overlay_mask/overlay_mask_header.js b/src-docs/src/views/overlay_mask/overlay_mask_header.js
index 8cc6053ef44..bb171176fbd 100644
--- a/src-docs/src/views/overlay_mask/overlay_mask_header.js
+++ b/src-docs/src/views/overlay_mask/overlay_mask_header.js
@@ -19,7 +19,7 @@ export default () => {
if (flyOut) {
flyout = (
-
+
diff --git a/src-docs/src/views/overlay_mask/props.tsx b/src-docs/src/views/overlay_mask/props.tsx
index 06aaead948b..527de3f4dab 100644
--- a/src-docs/src/views/overlay_mask/props.tsx
+++ b/src-docs/src/views/overlay_mask/props.tsx
@@ -1,21 +1,7 @@
-import React, { FunctionComponent, ReactNode } from 'react';
+import React, { FunctionComponent } from 'react';
import { CommonProps } from '../../../../src/components/common';
+import { EuiOverlayMaskInterface } from '../../../../src/components/overlay_mask/overlay_mask';
-interface EuiOverlayMaskInterface extends CommonProps {
- /**
- * Function that applies to clicking the mask itself and not the children
- */
- onClick?: () => void;
- /**
- * ReactNode to render as this component's children
- */
- children?: ReactNode;
- /**
- * Should the mask visually sit above or below the EuiHeader (controlled by z-index)
- */
- headerZindexLocation?: 'above' | 'below';
-}
-
-export const EuiOverlayMaskProps: FunctionComponent = () => (
-
-);
+export const EuiOverlayMaskProps: FunctionComponent<
+ EuiOverlayMaskInterface & CommonProps
+> = () => ;
diff --git a/src/components/code/__snapshots__/code_block.test.tsx.snap b/src/components/code/__snapshots__/code_block.test.tsx.snap
index 1e6ffd75302..6fe263cbd09 100644
--- a/src/components/code/__snapshots__/code_block.test.tsx.snap
+++ b/src/components/code/__snapshots__/code_block.test.tsx.snap
@@ -108,6 +108,7 @@ exports[`EuiCodeBlock fullscreen displays content in fullscreen mode 1`] = `
Object {
"insert": [Function],
"inserted": Object {
+ "animation-ox4vyo": true,
"dsw53p-empty-text-hoverStyles-EuiButtonIcon": true,
},
"key": "css",
@@ -118,6 +119,27 @@ exports[`EuiCodeBlock fullscreen displays content in fullscreen mode 1`] = `
"_insertTag": [Function],
"before": null,
"container":
+
+
+
+
+
,
- "ctr": 3,
+ "ctr": 6,
"insertionPoint": undefined,
"isSpeedy": false,
"key": "css",
@@ -177,6 +220,27 @@ exports[`EuiCodeBlock fullscreen displays content in fullscreen mode 1`] = `
.css-dsw53p-empty-text-hoverStyles-EuiButtonIcon:hover{background-color:rgba(211,218,230,0.2);}
,
+ ,
+ ,
+ ,
],
},
}
diff --git a/src/components/image/image.test.tsx b/src/components/image/image.test.tsx
index 5853d05bb4d..d006f715b37 100644
--- a/src/components/image/image.test.tsx
+++ b/src/components/image/image.test.tsx
@@ -191,7 +191,11 @@ describe('EuiImage', () => {
expect(overlayMask).toBeFalsy();
});
- test('close using overlay mask', () => {
+ // Clicking the mask to close is now handled by EuiFocusTrap
+ // and we can't use Enzyme to test this behavior.
+ // A Cypress test exists in the EuiFocusTrap suite that
+ // sufficiently covers this behavior
+ test.skip('close using overlay mask', () => {
let overlayMask = document.querySelectorAll(
'[data-test-subj=fullScreenOverlayMask]'
);
diff --git a/src/components/image/image_fullscreen_wrapper.tsx b/src/components/image/image_fullscreen_wrapper.tsx
index 7d2887aa063..e31ed0d3960 100644
--- a/src/components/image/image_fullscreen_wrapper.tsx
+++ b/src/components/image/image_fullscreen_wrapper.tsx
@@ -65,11 +65,8 @@ export const EuiImageFullScreenWrapper: FunctionComponent
];
return (
-
-
+
+
<>