processing / processing/p5.js

[p5.js 1.11.8 Bug Report]: mousePressed doesnt work on iPhone and iPad safari

Open
#7,941 5 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area:Events p5.js 2.0+
Dominant language
JavaScript
Stars
24k
Forks
3.8k
Avg merge
3d 16h
Merged PRs (30d)
25

Description

Most appropriate sub-area of p5.js?
  • Events
p5.js version

1.11.8

Web browser and version

iPhone Safari

Operating system

iOS

Steps to reproduce this
Steps:
  1. mousePressed does not work in iPhone Safari - 1.11.8 - https://editor.p5js.org/qalqi/sketches/IRxUM48mb

https://github.com/user-attachments/assets/81315614-08e6-4486-98e4-0a137ba0e2d5

  1. mousePressed works in iPhone Safari - 2.0.3 - https://editor.p5js.org/qalqi/sketches/IRxUM48mb

https://github.com/user-attachments/assets/e1cef539-f7dc-455a-977b-6aeb77d273aa

Snippet:

function setup() {
  createCanvas(400, 400);
}

function draw() {
  background(220);
}

function mousePressed() {
    alert('hi! Version 1.11.8')
}


A similar issue is earlier closed for touch move at https://github.com/processing/p5.js/issues/5358 #5358

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the linked sketches on iPhone or iPad Safari with p5.js 1.11.8, then compare the same sketch with 2.0.3. Trace the Events implementation responsible for mousePressed and verify that the handler fires on the affected Safari versions without breaking the working behavior.

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
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.