DylanSp / tic-tac-toe-react

A simple client-side Tic-Tac-Toe app for learning/practicing React.
MIT License
0 stars 1 forks source link

Clicks not detected on iOS #2

Open DylanSp opened 6 years ago

DylanSp commented 6 years ago

On an iPhone X, clicks on the board are not detected.

DylanSp commented 6 years ago

Issue replicated in Epiphany; looks like a known WebKit issue where onClick events don't fire for "non-interactive" elements like <canvas>.

Setting the canvas's CSS to cursor:pointer should solve the bug, though it doesn't in Epiphany; I'm not sure if this is due to differences between Epiphany and Safari mobile, or if the cursor:pointer fix just doesn't work.

DylanSp commented 6 years ago

react-tappable might be worth looking into.

DylanSp commented 5 years ago

cursor:pointer, at least as an inline style for Cell, didn't fix it. Neither did adding () => this.props.handleMove(this.props.cellNum) as a handler for onTouchEnd.

DylanSp commented 3 years ago

See "Safari Mobile" section of https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event#Usage_notes, though none of the listed workarounds work.