react icon indicating copy to clipboard operation
react copied to clipboard

Bug: Tap highlight effect on iPhone is throttled when button is rapidly tapped from React 17+

Open xsjcTony opened this issue 3 years ago • 2 comments

The tap highlight effect (a.k.a. -webkit-tap-highlight-color) on iPhone has been throttled if I tap the button rapidly from React 17+ (where events like onClick, onTouchStart work as expected no matter how quick I tap)

React version: 18.2.0

Steps To Reproduce

  1. Create a <button> element in React App
  2. Rapidly tap it on a mobile browser (any browser, my mobile is iPhone)

Link to code example: (open in a mobile browser) StackBlitz: React 18 (issue exists from 17+) StackBlitz: React 16 (issue does not exist, just for comparison)

Video

Problem exists: React18, React 17 Work as expected: Vue, React 16

Video

The current behavior

From React 17, the tap highlight effect is throttled when the button is rapidly tapped, and events work as expected (as you can see from the counter)

The expected behavior

Work as the same in React 16, but please note that touch-action: manipulation need to be added to the button in v16 to prevent double-tap zoom-in.

Extra

I've tried on Safari, Firefox and Edge on my iPhone and they behave the same.

Tested on Vue, React, Vanilla JS and the problem only exists from React 17.

And also, touch-action: manipulation is not needed for React 17+ but is required for all others to prevent double-tap zoom-in, so this behavior may be relevant to the problem.

Extra guessing: Is it because event handling behavior changes at React 17? or the behavior of how react handling mobile page has been changed (since touch-action: manipulation is no longer needed after v17)?

I cannot find any related topics in the community so I had to raise an issue here, thanks.

xsjcTony avatar Aug 15 '22 01:08 xsjcTony

Happening to me +1

danielanthonyl avatar Aug 19 '22 23:08 danielanthonyl

Strange also experienced a similar issue with React 18

Noah670 avatar Aug 25 '22 23:08 Noah670

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

github-actions[bot] avatar Apr 10 '24 02:04 github-actions[bot]

bump

xsjcTony avatar Apr 10 '24 02:04 xsjcTony

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

github-actions[bot] avatar Jul 09 '24 23:07 github-actions[bot]