Skip to content

Commit

Permalink
fix: Modal open should not block dropdown hidden (ant-design#44204)
Browse files Browse the repository at this point in the history
* refactor: adjust style

* fix: not event when hovering

* chore: add comment
  • Loading branch information
zombieJ authored Aug 14, 2023
1 parent 72b449a commit ee984fe
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions components/modal/style/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
}

Expand Down Expand Up @@ -95,6 +92,7 @@ export const genModalMaskStyle: GenerateStyle<TokenWithCommonCls<AliasToken>> =
zIndex: token.zIndexPopupBase,
height: '100%',
backgroundColor: token.colorBgMask,
pointerEvents: 'none',

[`${componentCls}-hidden`]: {
display: 'none',
Expand All @@ -103,9 +101,16 @@ export const genModalMaskStyle: GenerateStyle<TokenWithCommonCls<AliasToken>> =

[`${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',
},
},
},
},
Expand All @@ -120,14 +125,6 @@ const genModalStyle: GenerateStyle<ModalToken> = (token) => {
// ======================== Root =========================
{
[`${componentCls}-root`]: {
[`${componentCls}-wrap`]: {
zIndex: token.zIndexPopupBase,
position: 'fixed',
inset: 0,
overflow: 'auto',
outline: 0,
WebkitOverflowScrolling: 'touch',
},
[`${componentCls}-wrap-rtl`]: {
direction: 'rtl',
},
Expand Down

0 comments on commit ee984fe

Please sign in to comment.