diff --git a/components/modal/style/index.tsx b/components/modal/style/index.tsx index 77e007673b..14d1816625 100644 --- a/components/modal/style/index.tsx +++ b/components/modal/style/index.tsx @@ -62,10 +62,7 @@ export interface ModalToken extends FullToken<'Modal'> { function box(position: React.CSSProperties['position']): React.CSSProperties { return { position, - top: 0, - insetInlineEnd: 0, - bottom: 0, - insetInlineStart: 0, + inset: 0, }; } @@ -95,6 +92,7 @@ export const genModalMaskStyle: GenerateStyle> = zIndex: token.zIndexPopupBase, height: '100%', backgroundColor: token.colorBgMask, + pointerEvents: 'none', [`${componentCls}-hidden`]: { display: 'none', @@ -103,9 +101,16 @@ export const genModalMaskStyle: GenerateStyle> = [`${componentCls}-wrap`]: { ...box('fixed'), + zIndex: token.zIndexPopupBase, overflow: 'auto', outline: 0, WebkitOverflowScrolling: 'touch', + + // Note: Firefox not support `:has` yet + [`&:has(${componentCls}${antCls}-zoom-enter), &:has(${componentCls}${antCls}-zoom-appear)`]: + { + pointerEvents: 'none', + }, }, }, }, @@ -120,14 +125,6 @@ const genModalStyle: GenerateStyle = (token) => { // ======================== Root ========================= { [`${componentCls}-root`]: { - [`${componentCls}-wrap`]: { - zIndex: token.zIndexPopupBase, - position: 'fixed', - inset: 0, - overflow: 'auto', - outline: 0, - WebkitOverflowScrolling: 'touch', - }, [`${componentCls}-wrap-rtl`]: { direction: 'rtl', },