←back to thread

293 points ulrischa | 2 comments | | HN request time: 0.001s | source
1. watusername ◴[] No.42174968[source]
This seems like a self-inflicted bug resulted from incorrect heuristics (assumption that positive screenX/Y values represent mouse event), and the investigation was complicated by inadequate tracing/logging.

Instead of checking the more appropriate property that other commenters have suggested (pointerType), I'm a bit surprised that the solution given by the author is to patch up the shaky heuristics even more:

> We could deduce from our final two clues the solution: we need to check for negative numbers as well as positive numbers when checking the screenX and screenY coordinates.

replies(1): >>42175259 #
2. joshtumath ◴[] No.42175259[source]
Actually that is what we're going to do. I'm hoping to merging in code, soon, that will change it to use pointerId === -1 and then fall back to screenX === 0.

At the time this code was originally written four years ago or whenever it was, not all browsers used PointerEvent for click.