react-remove-scroll icon indicating copy to clipboard operation
react-remove-scroll copied to clipboard

Short interval touch events are not recognized in Safari

Open mottox2 opened this issue 5 years ago • 1 comments

Before react-remove-scroll mounted, it can detect taps at short interval (e.g. double tap), but once mounted it sometimes fails to recognize the double tap.

Reproduction

reproduction in codesandbox

  1. Open this URL in iOS Safari (iOS 13.4+).
  2. Make sure it counts up 2 with a double tap.
  3. Tap "Toggle RemoveScroll" button. (it makes react-remove-scroll mounted.)
  4. Double-tap to check that sometimes only one counts up.

I've seen this happen on iOS 13.4 and 13.5. but not on iOS 13.3 and iOS 12.2.

mottox2 avatar Jul 28 '20 03:07 mottox2

That's very interesting observation - look like something is preventing events from happening "faster" than 300ms each(I've measured), which is basically "onClick".

In other words that might mean that remove scroll by some way disabled touch end at all. Probably the root cause is somewhere inside react and using onTouchMoveCapture triggers that behavior. https://github.com/theKashey/react-remove-scroll/blob/master/src/UI.tsx#L30

theKashey avatar Jul 28 '20 07:07 theKashey

This issue has been marked as "stale" because there has been no activity for 2 months. If you have any new information or would like to continue the discussion, please feel free to do so. If this issue got buried among other tasks, maybe this message will reignite the conversation. Otherwise, this issue will be closed in 7 days. Thank you for your contributions so far.

stale[bot] avatar Apr 30 '23 07:04 stale[bot]