socketsupply / socket

A cross-platform runtime for Web developers to build desktop & mobile apps for any OS using any frontend library.
https://socketsupply.co/guides
Other
1.59k stars 74 forks source link

Trackpad tap events do not always work #942

Open jaymakes11 opened 6 months ago

jaymakes11 commented 6 months ago

What OS are you using (uname -a, or Windows version)?

Darwin MacBook-Pro.local 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct 9 21:27:24 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T6000 arm64

What version Socket Runtime are you using?

0.5.4 (97fa3f7c)

What programming language are you using (C/C++/Go/Rust)?

JS (Node v20.11.0)

What did you expect to see and what you saw instead?

Expect taps (on macbook pro's built-in trackpad) to work as expected Taps only work sometimes as expected

Created an isolated test case: https://github.com/jaymakes11/ssc-reproduce-tap-bug

Created a demo video in that repos README (watch with video's sound turned ON to hear the taps).

heapwolf commented 6 months ago

I was able to reproduce, the bug seems to be that the first tap on something that should be tappable isn't getting recognized, but all subsequent taps are. I'll look into this more.

jaymakes11 commented 6 months ago

the bug seems to be that the first tap on something that should be tappable isn't getting recognized, but all subsequent taps are.

Just a note here that I'm somewhat consistently seeing it happen on the same element (without taping something else in between taps), though I don't think this was shown in my demo video.

heapwolf commented 6 months ago

what's also a bit interesting is that tap on body always responds.

document.body.addEventListener('click', function() {
  console.log('BODY TAP') // tap is reliable
})

UPDATE: It also looks like the pointer down event fires reliably on all taps.

incrementButton.addEventListener('pointerdown', function() {
  console.log('BUTTON TAP') // tap is reliable
})