diff --git a/x-pack/plugins/timelines/public/components/actions/timeline/cases/create/flyout.tsx b/x-pack/plugins/timelines/public/components/actions/timeline/cases/create/flyout.tsx index a817bae996aa0..4f189648634d0 100644 --- a/x-pack/plugins/timelines/public/components/actions/timeline/cases/create/flyout.tsx +++ b/x-pack/plugins/timelines/public/components/actions/timeline/cases/create/flyout.tsx @@ -6,7 +6,7 @@ */ import React, { memo, useMemo } from 'react'; -import styled from 'styled-components'; +import styled, { createGlobalStyle } from 'styled-components'; import { EuiFlyout, EuiFlyoutHeader, EuiTitle, EuiFlyoutBody } from '@elastic/eui'; import * as i18n from '../translations'; @@ -28,6 +28,23 @@ const StyledFlyout = styled(EuiFlyout)` z-index: ${theme.eui.euiZModal}; `} `; + +const maskOverlayClassName = 'create-case-flyout-mask-overlay'; + +/** + * We need to target the mask overlay which is a parent element + * of the flyout. + * A global style is needed to target a parent element. + */ + +const GlobalStyle = createGlobalStyle<{ theme: { eui: { euiZModal: number } } }>` + .${maskOverlayClassName} { + ${({ theme }) => ` + z-index: ${theme.eui.euiZModal}; + `} + } +`; + // Adding bottom padding because timeline's // bottom bar gonna hide the submit button. const StyledEuiFlyoutBody = styled(EuiFlyoutBody)` @@ -68,16 +85,23 @@ const CreateCaseFlyoutComponent: React.FC = ({ }; }, [afterCaseCreated, onCloseFlyout, onSuccess, appId, disableAlerts]); return ( - - - -

{i18n.CREATE_TITLE}

-
-
- - {cases.getCreateCase(createCaseProps)} - -
+ <> + + + + +

{i18n.CREATE_TITLE}

+
+
+ + {cases.getCreateCase(createCaseProps)} + +
+ ); };