Bug when deleting code from the JS tab in full screen

Workflow:

  1. I have a script that I copied from somewhere else
  2. Paste it into the JS tab on a custom component I created
  3. Hit SAVE
  4. Change the script somewhere else, copied
  5. In the JS tab, I use CMD+A to select the whole script
  6. Hit DELETE. It doesn’t delete it. It goes to the beginning of the script.

I have to select all again, hit DELETE for it to actually delete the script, so I can paste the new version.

I believe this is an issue with the full screen version. Here’s what’s happening: when I delete the script (in full screen), if I then click the button to make it smaller, the script comes back, even though I deleted it. There’s something going on there.


EDIT: it’s actually not related to the full screen. For example, I add a script, save it, place the cursor somewhere to delete a character, the cursor jumps to the top of the script (full screen or not)

Can you confirm if you are on the latest version of Discourse?

Yes, 3.5.0.beta8-dev

I can’t repro this so far. What browser is it? Could you do a video to be sure we are not misunderstanding something please?

1 Like

Chrome Version 128.0.6613.138 (Official Build) (x86_64).

This is not something that happens all the time, but it happens. I can’t pinpoint how or when it happens. It seems kinda random.

But the issue is pretty simple to explain:

  • I open the Custom Code section of a custom component I created
  • Go to the JS tab where I already have some script
  • On my clipboard I have a new script to paste
  • I select all the script in the JS tab
  • Hit DELETE
  • The typing cursor (or whatever that thing is called) goes to the top of the window, the beginning of the script. It doesn’t delete it. I have to hit DELETE a second time to actually delete it so I can paste the new script.

That’s all I noticed so far. Again, I can’t really reproduce the issue all the time in order to make a video. I just tried, and nothing was wrong.

It’s a big deal, but something happens sometimes that causes this.