Skip to content

Commit 4015da4

Browse files
committed
popup 组件的 mask 在 iOS13 中可能出现穿透点击的处理
1 parent b8ecb84 commit 4015da4

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.4.35
2+
`2020-01-13`
3+
- **Bug Fix**
4+
- **popup** 组件在 iOS13 中点击可能出现穿透的情况处理;
5+
16
## 0.4.34
27

38
`2019-09-24`

components/popup/index.less

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@
44
}
55

66
&-mask {
7-
display: none;
7+
visibility: hidden;
88
position: fixed;
99
top: 0;
1010
bottom: 0;
1111
left: 0;
1212
right: 0;
1313
background-color: rgba(0, 0, 0, 0.75);
1414
opacity: 0;
15-
pointer-events: none;
1615
}
1716

1817
&-left {
@@ -46,16 +45,15 @@
4645
}
4746

4847
&-show &-mask {
49-
display: block;
48+
visibility: visible;
5049
opacity: 1;
51-
pointer-events: auto;
5250
}
5351

5452
&.animation &-content {
55-
transition: all 0.15s linear;
53+
transition: all 200ms linear;
5654
}
5755

5856
&.animation &-mask {
59-
transition: all 0.15s linear;
57+
transition: all 200ms linear;
6058
}
61-
}
59+
}

components/popup/index.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,16 @@ Component({
99
},
1010
methods: {
1111
onMaskTap() {
12-
const { onClose } = this.props;
12+
const { onClose, animation } = this.props;
1313

1414
if (onClose) {
15-
onClose();
15+
if (animation) {
16+
onClose();
17+
} else {
18+
setTimeout(() => {
19+
onClose();
20+
}, 200);
21+
}
1622
}
1723
},
1824
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mini-antui",
3-
"version": "0.4.34",
3+
"version": "0.4.35",
44
"description": "小程序版AntUI",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)