mousePressed / touchStarted not working on iOS Safari
Open
Nobody has claimed this yet.
Area:Events
Bug
- Dominant language
- JavaScript
- Stars
- 24k
- Forks
- 3.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 25
Description
Most appropriate sub-area of p5.js?
- Accessibility
- Color
- Core/Environment/Rendering
- Data
- DOM
- Events
- Image
- IO
- Math
- Typography
- Utilities
- p5.strands
- WebGL
- DevOps, Build process, Unit testing
- Internationalization (i18n)
- Friendly Errors
- Other (specify if possible)
p5.js version
2.1.1
Web browser and version
iOS 26
Operating system
iOS
Steps to reproduce this
2 Steps:
- Open THIS SKETCH on Safari on iOS
- Press any button
I have a keyPressed() function in the button class.
function screenInteract() {
button.keyPressed();
}
function mousePressed() {
screenInteract(mouseX, mouseY);
}
function touchStarted() {
if (touches.length > 0) {
screenInteract(touches[0].x, touches[0].y);
}
return false;
}
function touchEnded() {
if (touches.length > 0) {
screenInteract(touches[0].x, touches[0].y);
}
return false;
}
This does work on Chrome on Android. Any help appreciated!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by opening the linked sketch with p5.js 2.1.1 in Safari on iOS and reproduce the button interaction. Trace the mousePressed(), touchStarted(), and touchEnded() handlers shown in the report, then verify that the same interaction works on iOS Safari as it does in Chrome on Android.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100