0

I created a React game and it works great, but I found a lot of problems on Samsung tablet with Samsung web browser and keyboard attached. My game is designed to work on both touch screens and with mouse.

When I'm using this Samsung setup and I point an element with touchpad, the onPointerEnter event runs first as touch and then as mouse too, which makes it super unstable. Other pointer events are messed up too. On iPads with keyboard on the other hand, only mouse pointer event is being fired when using touchpad, which is understandable behavior.

Simple test:

<button onPointerEnter={console.log}>
    I'm a button
</button>

Is this a known problem and if so, what are the recommended steps to make it work correctly? I can't just block mouse events, because my game uses mouse too.

Robo Robok
  • 21,132
  • 17
  • 68
  • 126
  • It sounds like the keyboard touchpad is being treated as a touch screen by the device. – ryanwebjackson Mar 22 '23 at 20:01
  • Well, if you are convinced of that fact, then either you need to decide to prevent touch screen devices, or work around the issue (eat the events). – ryanwebjackson Mar 22 '23 at 20:06
  • maybe with the keyboard, the browser is trying to simulate mouse events too. Could only find old jquery fix: https://github.com/jquery-archive/PEP/pull/25 – Sysix Mar 22 '23 at 20:10
  • @Sysix thanks, but the problem is that in this case, mouse events are the "correct" ones so I should rather ignore the touch ones under some circumstances. – Robo Robok Mar 22 '23 at 20:19
  • is this bug also in chrome and firefox? when not, maybe create an ticket on samsung browser issue-tracker – Sysix Mar 22 '23 at 21:08
  • I don't know, I will install other browsers there and check. I'm debugging it at Samsung store – Robo Robok Mar 22 '23 at 21:31

0 Answers0