Skip to content

Commit

Permalink
fix: 修复 dialog 滚动失效问题 (#1130)
Browse files Browse the repository at this point in the history
* fix: 修复 dialog 滚动失效问题

* fix: 修复 dialog 滚动失效问题
  • Loading branch information
honkinglin authored Jul 2, 2022
1 parent b6295e6 commit 991ae2c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/dialog/dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export default defineComponent({
}
};
const overlayAction = (e: MouseEvent) => {
if (props.closeOnOverlayClick ?? global.value.closeOnOverlayClick) {
if (props.showOverlay && (props.closeOnOverlayClick ?? global.value.closeOnOverlayClick)) {
props.onOverlayClick?.({ e });
emitCloseEvent({
trigger: 'overlay',
Expand Down Expand Up @@ -283,14 +283,15 @@ export default defineComponent({
return (
// /* 非模态形态下draggable为true才允许拖拽 */

<div class={wrapClass.value}>
<div class={wrapClass.value} onClick={overlayAction}>
<div class={positionClass.value} style={positionStyle.value}>
<div
key="dialog"
class={dialogClass.value}
style={dialogStyle.value}
v-draggable={isModeLess.value && props.draggable}
ref="dialogEle"
onClick={(e) => e.stopPropagation()}
>
<div class={`${COMPONENT_NAME.value}__header`}>
{getIcon()}
Expand Down Expand Up @@ -329,12 +330,11 @@ export default defineComponent({
afterLeave,
hasEventOn,
renderDialog,
overlayAction,
};
},
render() {
const { COMPONENT_NAME, overlayAction } = this;
const maskView = this.isModal && <div key="mask" class={this.maskClass} onClick={overlayAction}></div>;
const { COMPONENT_NAME } = this;
const maskView = this.isModal && <div key="mask" class={this.maskClass}></div>;
const dialogView = this.renderDialog();
const view = [maskView, dialogView];
const ctxStyle = { zIndex: this.zIndex };
Expand Down

0 comments on commit 991ae2c

Please sign in to comment.