fastmail/Squire

Undo/ Redo does not reset the cursor position

paulflo150 opened this issue · 6 comments

Calling undo or redo does not set the cursor position, like the other commands do.

Is this the expected behavior?

neilj commented

Sorry, I'm not quite sure what you mean by this — undo/redo does restore the cursor position.

Hello @neilj, I created a stackblitz based on the demo provided, and when I click undo or redo the editor does not regain focus like it does for the other commands.

https://stackblitz.com/edit/web-platform-altctd?file=index.html

Does that make sense or am I looking at it wrong?

neilj commented

That seems to be behaving as I expect. Can you please provide:

  1. Exact steps to reproduce.
  2. What happened.
  3. What you expected to happen.

What I would expect is for the editor to become active again after I click undo or redo, just like it happens with bold for instance.

For instance:

  1. Type in "test test".
  2. Click the Undo button.
  3. Without reactivating the editor via mouse/ keyboard I should be able to continue typing, but I cannot because the editor does not appear to automatically regain focus.

This works perfectly fine if I use CTRL Z, but not if I use the button.

It also works when clicking on the Bold button: replace step 2 above with clicking on Bold.

2023-10-28_13-47-24.mp4

Once I clicked on Bold the editor is automatically reactivated and I can continue typing without any mouse or keyboard interaction.

I hope this makes sense.

neilj commented

Oh I see, I missed you were clicking a button rather than using the keyboard shortcut. Right, yes I agree that should focus, that's easy.

That sounds great, thank you!