Skip to content

Commit

Permalink
popup 组件的 mask 在 iOS13 中可能出现穿透点击的处理
Browse files Browse the repository at this point in the history
  • Loading branch information
linxz committed Jan 13, 2020
1 parent b8ecb84 commit 4015da4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,8 @@
## 0.4.35
`2020-01-13`
- **Bug Fix**
- **popup** 组件在 iOS13 中点击可能出现穿透的情况处理;

## 0.4.34

`2019-09-24`
Expand Down
12 changes: 5 additions & 7 deletions components/popup/index.less
Expand Up @@ -4,15 +4,14 @@
}

&-mask {
display: none;
visibility: hidden;
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: rgba(0, 0, 0, 0.75);
opacity: 0;
pointer-events: none;
}

&-left {
Expand Down Expand Up @@ -46,16 +45,15 @@
}

&-show &-mask {
display: block;
visibility: visible;
opacity: 1;
pointer-events: auto;
}

&.animation &-content {
transition: all 0.15s linear;
transition: all 200ms linear;
}

&.animation &-mask {
transition: all 0.15s linear;
transition: all 200ms linear;
}
}
}
10 changes: 8 additions & 2 deletions components/popup/index.ts
Expand Up @@ -9,10 +9,16 @@ Component({
},
methods: {
onMaskTap() {
const { onClose } = this.props;
const { onClose, animation } = this.props;

if (onClose) {
onClose();
if (animation) {
onClose();
} else {
setTimeout(() => {
onClose();
}, 200);
}
}
},
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "mini-antui",
"version": "0.4.34",
"version": "0.4.35",
"description": "小程序版AntUI",
"repository": {
"type": "git",
Expand Down

0 comments on commit 4015da4

Please sign in to comment.