carbon-tools / carbon

NO LONGER MAINTAINED - In-browser rich document editor.

Home Page:https://carbon.tools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Undo does not seem consistent

assembledadam opened this issue · comments

Fairly minor issue here. Here's an example to reproduce (I am using Chrome 50 on a Mac):

  1. Go to the editor demo.
  2. Go to a new paragraph, a single word of text.
  3. Hit enter/return, type a single word of text.
  4. Hit enter/return, type a single word of text.
  5. Press the undo button combo (CTRL + Z or CMD + Z). The word you just typed is removed, and the caret is moved to the beginning of the paragraph (as expected).
  6. Press the undo button combo again. Caret moved to the end of the previous word (as expected).
  7. Press the undo button combo again. At this point nothing happens, when the expected behavior is to remove the text of that line.

It appears a rogue (blank/empty) operation may be inserted at some point, requiring the user presses undo an extra time during editing. This appears to happen quite a lot, in a few different forms to the above.

Yeah I do see these in few cases and you're right most of the time the reason is that we execute multiple batch of operations to get the final result, I'll look into cases where we're doing this and see if we can consolidate these to be a one batch operation instead. In places this might be difficult to do we need to think of a way to "merge" these batches so the undo operation undo both batches instead of one - this is possible.