processing / p5.js-web-editor

The p5.js Editor is a website for creating p5.js sketches, with a focus on making coding accessible and inclusive for artists, designers, educators, beginners, and anyone else! You can create, share, or remix p5.js sketches without needing to download or configure anything.
https://editor.p5js.org
GNU Lesser General Public License v2.1
1.38k stars 1.33k forks source link

Some DOM elements stop working when you add some #2083

Closed codeMGL closed 1 year ago

codeMGL commented 1 year ago

If there are many (like 10) DOM elements each one with an event assigned, some of them (such as sliders, select boxes...) stop interacting with the user (as when you click or drag them). I have tried the same program on mobile and computer devices and I get no response from some of them.

welcome[bot] commented 1 year ago

Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already.

Yasir761 commented 1 year ago

Can you assign this issue to me?

raclim commented 1 year ago

@Yasir761 just assigned this issue to you!

Yasir761 commented 1 year ago

Hey! I'm not able to find the mentioned DOM element, can you please help out.

Noothan-am commented 1 year ago

hey @codeMGL is this issue still open , can you please give more details ?

codeMGL commented 1 year ago

First of all, sorry for the delay in my reply and for not making the bug explanation clear. I will try to explain better this time

Browser: Chrome Where: p5 web editor

In both iPad and computer, sliders do not move when the user tries to change their value In iPad (with Safari and Chrome), there is a malfunction of the color picker (called both from the HTML and the JS files, using createColorPicker) and the sliders. They may work or not.

Example: https://editor.p5js.org/MarcoGaLo/sketches/_Vhc1vmL3 It is a pixel art sketch. Just center on the following: At line 26, all the sliders are created (sat and bri variables) At lines 93 and 94, they are positionated. (At line 81 they change the saturation and brightness of my color picker) Note: As the p5 color picker didn’t work on mobile devices, I created my own.

I think that’s all. If you have any question, feel free to ask it

codeMGL commented 1 year ago

Trying to give you a simplified version of my sketch, I found the bug! It was on my own code. Trying to record changes on the drawing (to undo them), I made use of the mousePressed, mouseReleased and mouseDragged functions, which returned FALSE. This led the sliders not to interact with the user as the mouse was not pressed or dragged. I feel very bad for having confused an editor's bug with my mistake when writing the code of my program