Skip to content

Commit

Permalink
fix(web): 修复scroll-view/list-view 动态设置 refresher-triggered 为 true 时没有…
Browse files Browse the repository at this point in the history
…触发 refresherpulling 事件的Bug#2359
  • Loading branch information
Wangyaqi committed Jul 24, 2024
1 parent de57580 commit 7fa4665
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/uni-components/src/vue/list-view/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,10 @@ function handleTouchEvent(
// 之前是刷新状态则不再触发刷新
if (!beforeRefreshing) {
beforeRefreshing = true
trigger('refresherpulling', {} as Event, {
deltaY: state.refresherHeight,
dy: state.refresherHeight,
})
trigger('refresherrefresh', {} as Event, {
dy: touchEnd.y - touchStart.y,
})
Expand Down
4 changes: 4 additions & 0 deletions packages/uni-components/src/vue/scroll-view/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,10 @@ function useScrollViewLoader(
// 之前是刷新状态则不再触发刷新
if (!beforeRefreshing) {
beforeRefreshing = true
trigger('refresherpulling', {} as Event, {
deltaY: state.refresherHeight,
dy: state.refresherHeight,
})
trigger('refresherrefresh', {} as Event, {
dy: touchEnd.y - touchStart.y,
})
Expand Down
8 changes: 8 additions & 0 deletions packages/uni-h5/dist-x/uni-h5.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -6386,6 +6386,10 @@ function useScrollViewLoader(props2, state, scrollTopNumber, scrollLeftNumber, t
state.refresherHeight = props2.refresherThreshold;
if (!beforeRefreshing) {
beforeRefreshing = true;
trigger("refresherpulling", {}, {
deltaY: state.refresherHeight,
dy: state.refresherHeight
});
trigger("refresherrefresh", {}, {
dy: touchEnd.y - touchStart.y
});
Expand Down Expand Up @@ -8080,6 +8084,10 @@ function handleTouchEvent(isVertical, containerRef, props2, state, trigger, emit
state.refresherHeight = props2.refresherThreshold;
if (!beforeRefreshing) {
beforeRefreshing = true;
trigger("refresherpulling", {}, {
deltaY: state.refresherHeight,
dy: state.refresherHeight
});
trigger("refresherrefresh", {}, {
dy: touchEnd.y - touchStart.y
});
Expand Down
8 changes: 8 additions & 0 deletions packages/uni-h5/dist-x/uni-h5.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -14234,6 +14234,10 @@ function useScrollViewLoader(props2, state2, scrollTopNumber, scrollLeftNumber,
state2.refresherHeight = props2.refresherThreshold;
if (!beforeRefreshing) {
beforeRefreshing = true;
trigger("refresherpulling", {}, {
deltaY: state2.refresherHeight,
dy: state2.refresherHeight
});
trigger("refresherrefresh", {}, {
dy: touchEnd.y - touchStart.y
});
Expand Down Expand Up @@ -16420,6 +16424,10 @@ function handleTouchEvent(isVertical, containerRef, props2, state2, trigger, emi
state2.refresherHeight = props2.refresherThreshold;
if (!beforeRefreshing) {
beforeRefreshing = true;
trigger("refresherpulling", {}, {
deltaY: state2.refresherHeight,
dy: state2.refresherHeight
});
trigger("refresherrefresh", {}, {
dy: touchEnd.y - touchStart.y
});
Expand Down
4 changes: 4 additions & 0 deletions packages/uni-h5/dist/uni-h5.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -6308,6 +6308,10 @@ function useScrollViewLoader(props2, state, scrollTopNumber, scrollLeftNumber, t
state.refresherHeight = props2.refresherThreshold;
if (!beforeRefreshing) {
beforeRefreshing = true;
trigger("refresherpulling", {}, {
deltaY: state.refresherHeight,
dy: state.refresherHeight
});
trigger("refresherrefresh", {}, {
dy: touchEnd.y - touchStart.y
});
Expand Down
4 changes: 4 additions & 0 deletions packages/uni-h5/dist/uni-h5.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -13722,6 +13722,10 @@ function useScrollViewLoader(props2, state2, scrollTopNumber, scrollLeftNumber,
state2.refresherHeight = props2.refresherThreshold;
if (!beforeRefreshing) {
beforeRefreshing = true;
trigger("refresherpulling", {}, {
deltaY: state2.refresherHeight,
dy: state2.refresherHeight
});
trigger("refresherrefresh", {}, {
dy: touchEnd.y - touchStart.y
});
Expand Down

0 comments on commit 7fa4665

Please sign in to comment.