cubing / cubing.js

🛠 A library for displaying and working with twisty puzzles. Also currently home to the code for Twizzle.
https://js.cubing.net/cubing/
GNU General Public License v3.0
241 stars 44 forks source link

TwistyAlgViewer moves cursor around undermining user #184

Open rokicki opened 2 years ago

rokicki commented 2 years ago

To Reproduce Steps to reproduce the behavior:

  1. Go to https://alpha.twizzle.net/explore
  2. Type or paste this algorithm: M2 U' M' U2 M U' M2'
  3. Move the cursor in the alg textarea to the end of the line.
  4. Hit carriage return (cursor now at end of next line).
  5. Hit up arrow (cursor now at beginning of first line).
  6. Type two forward slashes to comment out the alg.
  7. The cursor now is forced to the end of the first line.

Expected behavior TwistyAlgViewer should never move the cursor in response to a typed normal character.

I suspect this is happening as part of some sort of normalization of the alg, as the "extra" carriage return at the end of the alg also disappears as part of this. I want that extra carriage return to stay there.

Browser: Chrome on MacOS.

lgarron commented 2 years ago

I presume you mean TwistyAlgEditor?

In general I need to still make a whole bunch of fixes, which are all really annoying due to async code interacting with sync code. I'll make sure this particular repro gets fixed.