Skip to content
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

[PullRefresh] 在任意位置使用手势下滑都会触发onRefresh #299

Open
1 task done
canvascat opened this issue Nov 18, 2024 · 0 comments
Open
1 task done

Comments

@canvascat
Copy link

canvascat commented Nov 18, 2024

Basic Info

BUG:在任意位置使用手势(下滑)向上滚动都会触发onRefresh

预期:滚动到顶部后再下滑才触发onRefresh

20241118113043_rec_

import { PullRefresh, Toast } from "@arco-design/mobile-react";
import React from "react";

const onRefresh = () =>
  new Promise((resolve) => setTimeout(resolve, 100)).then(() => {
    Toast.info(
      `Refresh successfully @${new Intl.DateTimeFormat("zh-CN", {
        timeStyle: "medium",
      }).format(new Date())}`
    );
  });

const data = Array.from({ length: 20 }, (_, index) => `index: ${index}`);

export default function PullRefreshDemo() {
  return (
    <PullRefresh onRefresh={onRefresh}>
      {data.map((item) => (
        <div key={item} style={{ paddingBlockEnd: 50 }}>
          {item}
        </div>
      ))}
    </PullRefresh>
  );
}

但时当给.arco-pull-refresh-content.arco-pull-refresh添加高度样式后行为正常

.arco-pull-refresh{
  height: 100vh
}
@canvascat canvascat changed the title [PullRefresh] 使用手势下滑就就会触发了onRefresh [PullRefresh] 在任意位置使用手势下滑都会触发了onRefresh Nov 18, 2024
@canvascat canvascat changed the title [PullRefresh] 在任意位置使用手势下滑都会触发了onRefresh [PullRefresh] 在任意位置使用手势下滑都会触发onRefresh Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant