p5.js
p5.js copied to clipboard
Problem with a touch event on mobile device
Most appropriate sub-area of p5.js?
- [ ] Accessibility (Web Accessibility)
- [ ] Build tools and processes
- [ ] Color
- [X] Core/Environment/Rendering
- [ ] Data
- [ ] DOM
- [ ] Events
- [ ] Friendly error system
- [ ] Image
- [ ] IO (Input/Output)
- [ ] Localization
- [ ] Math
- [ ] Unit Testing
- [ ] Typography
- [ ] Utilities
- [ ] WebGL
- [ ] Other (specify if possible)
p5.js version
1.4.0
Web browser and version
Chrome 101.0.4951.44
Operating System
iOS 14.7.1
Steps to reproduce this
Steps:
- Open https://editor.p5js.org/Michal8705/full/PaTRVm7UP on Chrome
- When I roll up the top bar with a quick movement (screen1), then in the text field is all the time false and touching event did not work (screen2). In iOS without this action all the time text information is 'false'
Does anyone know how to solve this problem or maybe a fix in p5 is needed?
My code below https://editor.p5js.org/Michal8705/sketches/PaTRVm7UP
Hi @Michal8705, by Chrome do you mean Chrome on desktop or Chome on iOS? Conversely by iOS do you mean in Safari or just in general? Does this happen only in the web editor or can it be replicated if you are not using the web editor?
Hi, sorry for the late reply, but I'm on vacation. The error occurred on Chrome on iPhone 7 with iOS. I checked on Xiaomi with Android and the error didn't appear. Interestingly, the error didn't appear when I transferred the code to Github Pages. There, it works fine on every device. So the first conclusion is that the problem is with the web editor. However, I will try to do more tests.
Hello, seems like a valid problem. I would like to work on this. Shall I go ahead?
@TsarPrince It would help if you can try and isolate the problem as mentioned first. We need to know under what conditions does this problem occur before we can suggest a fix.
@limzykenneth I tested the above link mentioned by @Michal8705 both on Safari and Chrome on iPhone 12. The link has changed a little but the underlying problem is still same - seems like mouseX is not working on iPhone platform. Also, it works as intended in android (tested on Google Pixel 4A and Samsung Tab A7).
Seems like this is an "expected" behaviour of iOS, this problem was also faced by React which I found here.