p5.js icon indicating copy to clipboard operation
p5.js copied to clipboard

Problem with a touch event on mobile device

Open Michal8705 opened this issue 3 years ago • 2 comments
trafficstars

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:

  1. Open https://editor.p5js.org/Michal8705/full/PaTRVm7UP on Chrome
  2. 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

screen1 screen2

Michal8705 avatar Apr 29 '22 14:04 Michal8705

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?

limzykenneth avatar Apr 29 '22 15:04 limzykenneth

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.

Michal8705 avatar May 05 '22 17:05 Michal8705

Hello, seems like a valid problem. I would like to work on this. Shall I go ahead?

TsarPrince avatar Dec 27 '22 11:12 TsarPrince

@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 avatar Dec 28 '22 21:12 limzykenneth

@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).

TsarPrince avatar Dec 29 '22 04:12 TsarPrince

Seems like this is an "expected" behaviour of iOS, this problem was also faced by React which I found here.

TsarPrince avatar Dec 29 '22 05:12 TsarPrince