sprig icon indicating copy to clipboard operation
sprig copied to clipboard

Editors change wrong template literal

Open MacaylaMarvelous81 opened this issue 1 year ago • 0 comments

Describe the bug Sometimes, when using an editor, the wrong template literal is edited. I've replicated this with the map editor as well as the color selector.

To Reproduce Steps to reproduce the behavior:

  1. Change a map or color using an editor (you may need to make multiple changes/click multiple times)
  2. Close the editor and check for incorrect changes I've experienced this bug in Safari on MacOS and Chrome on ChromeOS.

Expected behavior The correct map or color is changed.

Actual behavior
The map or color overwrites another template literal.

Screenshots

Minimal reproducible example:

https://github.com/user-attachments/assets/fd5c93da-e75e-4a4e-a257-908979079280

In this video the color a overwrites map b.

const player = "p"

setLegend(
  [ player, bitmap`
................
................
.......000......
.......0.0......
......0..0......
......0...0.0...
....0003.30.0...
....0.0...000...
....0.05550.....
......0...0.....
.....0....0.....
.....0...0......
......000.......
......0.0.......
.....00.00......
................` ]
)

const a = color``
const b = map`
..........
ppppp.....
.....pp...
.....pp...
.....p....
...ppp....
..........
..........`

Sprig snapshot: https://sprig.hackclub.com/share/WqpImishd1BOavNdMO0C

Other:

https://github.com/user-attachments/assets/210efd4e-b7f2-46c5-b823-94a2aeccfe55

In this video a color overwrites a map, and then a different map gets edited than the one that was clicked on.
Sprig snapshot: https://sprig.hackclub.com/share/Ug8ukF5tCv8ZowXttYeb

MacaylaMarvelous81 avatar Sep 06 '24 14:09 MacaylaMarvelous81