Skip to content

TouchableOpacity triggering <input> and <TextInput> #1164

@bcpugh

Description

@bcpugh

The problem
On safari mobile, TouchableOpacity will trigger another component at the same location when changing views (if second component is an "<input>" or "<TextInput>").

<input> example provided below. Similar behavior for a TextInput at same location; however, unable to reproduce succinctly in sandbox (using Redux Form for this implementation).

How to reproduce
https://codesandbox.io/s/6njwzqojnr
(I tried to minimize redux / router code).
If you load on mobile safari on iPhone and click the upper left of the first component (i.e.TouchableOpacity, blue) it will trigger the second component (i.e. <input>, red).

Steps to reproduce:

  1. TouchableOpacity overlapping where in second view, w/ onPress triggers view change
  2. User touches TouchableOpacity in the overlapping location
  3. gets triggered unintentionally. Longer presses increase frequency of unexpected behavior

Expected behavior
Expected touchstart and touchend events only.
(Using safari devtools hooked up to my iPhone, recorded events are: touchstart, touchend, mouseover, mousemove, mousedown, mouseup, and click (<-- targets the input file). In my app, the final click gets fired twice, even.

RNW: 0.9.6
RN: 0.57.4
Browser: Safari (iOS12, iPhone 7)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions