Ctrl+Z does not undo my previous step

When I type something in the textarea , and select all, and ctrl+b ,and ctrl+z.

I just want to undo my ctrl+b step, however it completely my textarea. I have to type the content again.

It is weird the ctrl+z means clearing textarea instead of undo.

This is 100% browser and OS specific, we do not override the default browser text box handling of these keys. You can experiment here:

Take http://codepen.io/anon/pen/uryJl which contains a plain html text box.

In different web browsers, type in

test line one
test line two
test line three

And then try ctrl+z.

Depends on the browser and whether you naturally pause or not when typing. Play with it and see.

1 Like

Combo Ctrl + Z does work. But if you apply click on any button on composer’s toolbar (or call it via combo key), it doesn’t work.

Press ctrl+y to redo the undo if that is the case. You do not have to re type the content…

I think what they want to say is that the editor does not distinguish between typed user input and editor actions like Ctrl-B, Ctrl-R etc. The browser interprets all this as input and if you say “undo”, it does that: it undos all user input, including typed text and Ctrl-keypresses. This, however, is general behaviour of browsers - any browser-based web app behaves this way.

The only solution I see here would be to integrate the undo functionality into the Discourse editor - but this seems like a huge piece of work for a very limited effect - I personally never missed this, neither in Discourse, nor in other forum software…

2 Likes

We used to do that, and it just cause a lot of pain and confusion.

3 Likes

Just installed the latest upgrade that fixes “Keyboard shortcuts not working anymore”.

Now it behaves like this:

  • When I press Ctrl+B it makes the selected text bold.
  • When I press Ctrl+Z (undo) nothing happens. I.e. the bold text stays bold.

Is this the correct/expected behaviour?

Yes, bolding works but undo is disabled.

1 Like