p5.js-web-editor icon indicating copy to clipboard operation
p5.js-web-editor copied to clipboard

Web editor switches back to previous file after saving and switching files

Open DavieJones49 opened this issue 6 months ago • 3 comments

p5.js version

1.11.3

What is your operating system?

Chromebook

Web browser and version

Chrome

Actual Behavior

When editing sketch files: pressing ctrl+S to save the changes and immediately navigate to a different file before it finishes saving. The web editor switches to the previous file at the same time the "sketch saved" message appears despite the user not having commanded the file switch.

https://github.com/user-attachments/assets/3c06d3f2-9fbe-4888-9daa-14d8f084c9da

Expected Behavior

The editor should not switch to the previous file without user input.

Steps to reproduce

Steps:

  1. open a p5js web editor project
  2. press SAVE, ctrl+S, or trigger an autosave, then immediately navigate to another sketch file BEFORE the "sketch saved" message appears.
  3. When the "sketch saved" message appears, the web editor will navigate back to the file you were on when you triggered the save, without any user input.

sample project: https://editor.p5js.org/davidjramirez04/sketches/sIEIjaKEI Hyperkhukku battle simulator (google it)

DavieJones49 avatar May 27 '26 23:05 DavieJones49

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.

welcome[bot] avatar May 27 '26 23:05 welcome[bot]

Hey! Thanks for flagging this! I've verified i can recreate the issue, although it seems like a rare edge case so I've labelled it low priority for now.

khanniie avatar May 28 '26 21:05 khanniie

hi @khanniie i would like to work on this issue can you assign it to me

parthjadhao01 avatar May 29 '26 18:05 parthjadhao01