Closed alexanderjakob closed 5 years ago
Hi @aj1991, can you give me some details about the mobile device you are using?
we're facing issues as well with the last versions of iOS Safari reporting mouse input and intent.
we were able to reproduce this on the official demo page.
Hi @risker, I was able to reproduce this only through rapid tapping. I think I solved it by increasing a timer that prevents the mousedown
event from being reported. Can you try the version in this branch https://github.com/ten1seven/what-input/tree/touch-buffering and let me know if that works for you?
It still pretty regularly reports mouse. I wouldn't call it "rapid tapping", most often it reports mouse after a longer tap - when you don't take your finger off the screen immediately, it mostly reports "mouse", not "touch".
Well... apparently I found and fixed an unreported bug then 😄
I'll keep looking. What device (hardware) are you seeing this on? Newer hardware has the 3D Press that can take over a longer tap (though a long tap is also possible, of course).
Currently i was testing this on a few years old iPad mini, but could also reproduce this on my colleague's iPhone 7, for example.
edit:
I wonder if we could do a window.matchMedia('(hover: hover), (any-hover: hover)').matches
check inside the mouse event handlers & bail if that check does not match? i'll try to test this out on different devices tomorrow that have both touch & mouse support.
I have yet to be able to reproduce this. I've been testing on the demo page (and to be clear, the touch-buffering
branch has not been deployed there). I tried my physical iPhone 8 as well as the Xcode simulator. If there's any way you could take a video of how you're reproducing it, I'd appreciate it.
We are experiencing the same behaviour with CSS selectors. We are targeting page elements with the CSS selector [data-whatintent='mouse'] . We are then seeing these styles being applied when pressing on mobile devices.
Edit: Specifically ios. Works fine on Android.
Thanks, @shanholmes I have a bit of time to check this out this week!
I was finally able to spend some time with this and reproduce the issue! I have a pre-release for you all to check out. Please try it out if you're able and let me know if the issue is corrected for you (or if you uncover any regressions). Thanks!
Pre-release: https://github.com/ten1seven/what-input/releases/tag/v5.2.0
Branch: https://github.com/ten1seven/what-input/tree/88-ios-mouse-reporting
I did a bunch of testing on my end and no longer could reproduce the issue. Here's the official release: https://github.com/ten1seven/what-input/releases/tag/v5.2.1
Forgot to say, it fixed our issues too. Thanks for the awesome work!
Great, thanks for the follow-up!
Today I got the following state back after alerting whatInput.ask() - but I was on my mobile device. I was getting this by switching between different input fields (click in one input switch to another).
Version: 5.1.2