Ctrl+Z does not undo my previous step

(jark) #1

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.

Pressing shift+enter in quoted text isn't undoable
Undo (Ctrl/Cmd+Z) doesn't work for Markdown
(Jeff Atwood) #2

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 An Anonymous Pen on CodePen 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.

(Khoa Nguyen) #3

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.

(Jeff Atwood) #4

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

(Joe Seyfried) #5

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…

(Sam Saffron) #6

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

(Uwe Keim) #7

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?

(Robin Ward) #8

Yes, bolding works but undo is disabled.