Skip to content

Commit c658a53

Browse files
authored
fix(PullDownRefresh): resolved the loading text cannot be hidden in some low-level iOS systems (#3239)
1 parent 6aae772 commit c658a53

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/pull-down-refresh/pull-down-refresh.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ export default class PullDownRefresh extends SuperComponent {
2020
/** 关闭动画耗时setTimeout句柄 */
2121
closingAnimateTimeFlag = 0;
2222

23+
/** 恢复刷新状态句柄 */
24+
refreshStatusTimer = null;
25+
2326
externalClasses = [`${prefix}-class`, `${prefix}-class-loading`, `${prefix}-class-text`, `${prefix}-class-indicator`];
2427

2528
options = {
@@ -66,6 +69,7 @@ export default class PullDownRefresh extends SuperComponent {
6669
detached() {
6770
clearTimeout(this.maxRefreshAnimateTimeFlag);
6871
clearTimeout(this.closingAnimateTimeFlag);
72+
this.resetTimer();
6973
},
7074
};
7175

@@ -84,6 +88,13 @@ export default class PullDownRefresh extends SuperComponent {
8488
}
8589
},
8690
barHeight(val) {
91+
this.resetTimer();
92+
if (val === 0 && this.data.refreshStatus !== -1) {
93+
this.refreshStatusTimer = setTimeout(() => {
94+
this.setData({ refreshStatus: -1 });
95+
}, 240);
96+
}
97+
8798
this.setData({ tipsHeight: Math.min(val, this.data._loadingBarHeight) });
8899
},
89100

@@ -97,6 +108,13 @@ export default class PullDownRefresh extends SuperComponent {
97108
};
98109

99110
methods = {
111+
resetTimer() {
112+
if (this.refreshStatusTimer) {
113+
clearTimeout(this.refreshStatusTimer);
114+
this.refreshStatusTimer = null;
115+
}
116+
},
117+
100118
onScrollToBottom() {
101119
this.triggerEvent('scrolltolower');
102120
},

0 commit comments

Comments
 (0)