Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dialog): 修复dialog组件z-idnex层级问题 #343

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions src/dialog/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,6 @@ export const Dialog: React.FC<DialogProps> = (props) => {
},
});

// 蒙层动画
const maskSpring = useSpring({
opacity: visible ? 1 : 0,
onStart: () => {
setActive(true);
},
onRest: () => {
setActive(visible);
},
});

// 蒙层点击事件
const onOverlayClickHandle = useCallback(
(e) => {
Expand Down Expand Up @@ -228,9 +217,7 @@ export const Dialog: React.FC<DialogProps> = (props) => {
}}
>
{showOverlay ? (
<animated.div style={maskSpring}>
<Overlay onOverlayClick={onOverlayClickHandle} disableBodyScroll={false} />
</animated.div>
<Overlay visible={visible} onOverlayClick={onOverlayClickHandle} disableBodyScroll={false} />
) : null}
<div className="wrap" style={wrapStyle}>
<animated.div style={dialogSpring}>{dialog}</animated.div>
Expand Down