Skip to content

fix(PullDownRefresh): 修复内嵌PullDownRefresh无法左右滑动 #1821

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 9, 2025
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions src/pull-down-refresh/pull-down-refresh.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,14 @@
}
});

// 统一判断是否可以滑动
const isTouchable = () => loading.value || props.disabled;

const onTouchStart = (e: TouchEvent) => {
e.stopPropagation();
if (!isReachTop(e) || loading.value || props.disabled) return;
if (isTouchable()) return;
if (!isReachTop(e)) return;


Check failure on line 100 in src/pull-down-refresh/pull-down-refresh.tsx

View workflow job for this annotation

GitHub Actions / call-test-build / test

Delete `⏎`
clearTimeout(timer);
timer = null;
distance.value = 0;
Expand All @@ -102,8 +106,9 @@
};

const onTouchMove = (e: TouchEvent) => {
e.stopPropagation();
if (!isReachTop(e) || loading.value || props.disabled) return;
if (isTouchable()) return;
if (!isReachTop(e)) return;

touch.move(e);

const { diffY, diffX } = touch;
Expand Down Expand Up @@ -134,8 +139,8 @@
};

const onTouchEnd = (e: TouchEvent) => {
e.stopPropagation();
if (!isReachTop(e) || loading.value || props.disabled) return;
if (isTouchable()) return;
if (!isReachTop(e)) return;

if (status.value === 'loosing') {
distance.value = loadingBarHeight.value;
Expand Down
Loading