Skip to content

Commit

Permalink
Do not allow the css prop on EuiOverlayMask (elastic#6296)
Browse files Browse the repository at this point in the history
- since the mask is essentially a raw DOM node/element, it can't accept a react `css` prop
  • Loading branch information
Constance authored Oct 6, 2022
1 parent 378b90c commit ea5200e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src-docs/src/views/overlay_mask/props.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import { CommonProps } from '../../../../src/components/common';
import { EuiOverlayMaskInterface } from '../../../../src/components/overlay_mask/overlay_mask';

export const EuiOverlayMaskProps: FunctionComponent<
EuiOverlayMaskInterface & CommonProps
EuiOverlayMaskInterface & Omit<CommonProps, 'css'>
> = () => <div />;
3 changes: 1 addition & 2 deletions src/components/overlay_mask/overlay_mask.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export interface EuiOverlayMaskInterface {
maskRef?: Ref<HTMLDivElement> | MutableRefObject<HTMLDivElement>;
}

export type EuiOverlayMaskProps = CommonProps &
export type EuiOverlayMaskProps = Omit<CommonProps, 'css'> &
Omit<
Partial<Record<keyof HTMLAttributes<HTMLDivElement>, string>>,
keyof EuiOverlayMaskInterface
Expand All @@ -55,7 +55,6 @@ export const EuiOverlayMask: FunctionComponent<EuiOverlayMaskProps> = ({
children,
headerZindexLocation = 'above',
maskRef,
css, // TODO: apply custom CSS-in-JS as a className
...rest
}) => {
const [overlayMaskNode, setOverlayMaskNode] = useState<HTMLDivElement | null>(
Expand Down

0 comments on commit ea5200e

Please sign in to comment.