Skip to content

Commit c537ff3

Browse files
committed
fix(rn): popup关闭闪烁问题
1 parent 1c342a2 commit c537ff3

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

packages/mpx-cube-ui/lib/components/popup/rn-mixin.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,22 +101,19 @@ if (__mpx_mode__ === 'ios' || __mpx_mode__ === 'android') {
101101
animation[this.targetTranslate](start).step({ duration: 0 });
102102
}
103103
animation[this.targetTranslate](0).step();
104-
this.targetTranslateValue = 0;
105104
}
106105
else {
107106
animation[this.targetTranslate](start).step();
108-
this.targetTranslateValue = start;
109107
}
110108
this.animationData = animation.export();
111109
this.transitionendTimer = setTimeout(() => {
112110
this.transitionend();
113-
}, animationOptions.duration + 10);
111+
}, animationOptions.duration);
114112
},
115113
transitionend() {
116114
if (this.isVisible && this.targetTranslate) {
117-
this.contentTranslateStyle = {
118-
[this.targetTranslate]: this.targetTranslateValue
119-
};
115+
// 触发重新渲染
116+
this.contentTranslateStyle = {};
120117
}
121118
},
122119
// @vuese

packages/mpx-cube-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mpxjs/mpx-cube-ui",
3-
"version": "1.3.14-beta.2",
3+
"version": "1.3.14-beta.3",
44
"description": "mpx components library",
55
"author": "xiaolei <[email protected]>",
66
"publishConfig": {

packages/mpx-cube-ui/src/components/popup/rn-mixin.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,21 +108,18 @@ if (__mpx_mode__ === 'ios' || __mpx_mode__ === 'android') {
108108
animation[this.targetTranslate](start).step({ duration: 0 })
109109
}
110110
animation[this.targetTranslate](0).step()
111-
this.targetTranslateValue = 0
112111
} else {
113112
animation[this.targetTranslate](start).step()
114-
this.targetTranslateValue = start
115113
}
116114
this.animationData = animation.export()
117115
this.transitionendTimer = setTimeout(() => {
118116
this.transitionend()
119-
}, animationOptions.duration + 10)
117+
}, animationOptions.duration)
120118
},
121119
transitionend() {
122120
if (this.isVisible && this.targetTranslate) {
123-
this.contentTranslateStyle = {
124-
[this.targetTranslate]: this.targetTranslateValue
125-
}
121+
// 触发重新渲染
122+
this.contentTranslateStyle = {}
126123
}
127124
},
128125
// @vuese

0 commit comments

Comments
 (0)