Skip to content

Commit 7f00868

Browse files
committed
chore: 1.4.17-btn.beta.0 rn bindtransitionend
1 parent 079e0bc commit 7f00868

5 files changed

Lines changed: 11 additions & 13 deletions

File tree

packages/mpx-cube-ui/lib/components/popup/index.mpx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@
6767
wx:ref="popup-content"
6868
class="cube-popup-content {{ transition }}"
6969
wx:style="{{ [styleConfig.content, contentTranslateStyle] }}"
70-
animation="{{ animationData }}">
70+
animation="{{ animationData }}"
71+
bindtransitionend="transitionend">
7172
<slot></slot>
7273
</view>
7374
</view>

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,10 @@ if (__mpx_mode__ === 'ios' || __mpx_mode__ === 'android' || __mpx_mode__ === 'ha
109109
animation[this.targetTranslate](start).step();
110110
}
111111
this.animationData = animation.export();
112-
this.transitionendTimer = setTimeout(() => {
113-
this.transitionend();
114-
}, animationOptions.duration);
115112
},
116-
transitionend() {
117-
if (this.isVisible && this.targetTranslate) {
113+
transitionend(e) {
114+
const { elapsedTime, finished } = e.detail;
115+
if (elapsedTime && finished && this.isVisible && this.targetTranslate) {
118116
// 触发重新渲染
119117
this.contentTranslateStyle = {};
120118
}

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.4.12-btn.3",
3+
"version": "1.4.17-btn.beta.0",
44
"description": "mpx components library",
55
"author": "xiaolei <xiaolei@didichuxing.com>",
66
"publishConfig": {

packages/mpx-cube-ui/src/components/popup/index.mpx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@
6767
wx:ref="popup-content"
6868
class="cube-popup-content {{ transition }}"
6969
wx:style="{{ [styleConfig.content, contentTranslateStyle] }}"
70-
animation="{{ animationData }}">
70+
animation="{{ animationData }}"
71+
bindtransitionend="transitionend">
7172
<slot></slot>
7273
</view>
7374
</view>

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,10 @@ if (__mpx_mode__ === 'ios' || __mpx_mode__ === 'android' || __mpx_mode__ === 'ha
115115
animation[this.targetTranslate](start).step()
116116
}
117117
this.animationData = animation.export()
118-
this.transitionendTimer = setTimeout(() => {
119-
this.transitionend()
120-
}, animationOptions.duration)
121118
},
122-
transitionend() {
123-
if (this.isVisible && this.targetTranslate) {
119+
transitionend(e) {
120+
const { elapsedTime, finished } = e.detail
121+
if (elapsedTime && finished && this.isVisible && this.targetTranslate) {
124122
// 触发重新渲染
125123
this.contentTranslateStyle = {}
126124
}

0 commit comments

Comments
 (0)