3lang3 / react-vant

React mobile UI Components base on Vant
https://react-vant.3lang.dev
MIT License
1.32k stars 189 forks source link

fix(FloatingPanel): fix stuck during indetermine direction #631

Closed luo3house closed 1 year ago

luo3house commented 1 year ago

iOS: if touch events triggered but touch direction not recognized by getDirection, then

  1. FloatingPanel(FP) treat this touch as dragging and prevent it.
  2. Until direction recognized and we try to scroll content, FP think it is not dragging then expectedly ignore
  3. But the first touch move event is prevented, subsequent events are not active for content scrolling.

Reproduction: https://react-vant-pr-627.surge.sh/~demo/components/floating-panel

  1. Scroll panel to max anchor
  2. Try scroll content
  3. Get stuck sometimes.
github-actions[bot] commented 1 year ago

PR preview has been successfully built and deployed to https://react-vant-pr-631.surge.sh.

github-actions[bot] commented 1 year ago

PR preview has been successfully built and deployed to https://react-vant-pr-631.surge.sh.

github-actions[bot] commented 1 year ago

PR preview has been successfully built and deployed to https://react-vant-pr-631.surge.sh.

github-actions[bot] commented 1 year ago

PR preview has been successfully built and deployed to https://react-vant-pr-631.surge.sh.

github-actions[bot] commented 1 year ago

PR preview has been successfully built and deployed to https://react-vant-pr-631.surge.sh.

3lang3 commented 1 year ago

好兄弟,我没时间review了,确定我明天就合完发版了

luo3house commented 1 year ago

好兄弟,我没时间review了,确定我明天就合完发版了

辛苦了,draft 转 ready 通常表示ok

这条 PR 主要解决 touch 方向读不出来 ( useTouch 需要 MIN_DISTANCE ),而提前阻止了事件导致卡住的问题。

LarryHangFan commented 2 months ago

没人碰到FloatingPanel内的元素滚动失效了,滚动触发的是拖拽,

image

这两个属性开放很有必要的