Javascript undo does not seem to work reliablly |
|||
Issue description
1. Open gmail compose
2. connect using chrome://inspect
3. type "Test"
4. do a document.execcommand("undo")
5. It seems to delete one character at a time for the first 2 undo's and then it deletes "Te" at once.
,
Mar 31 2017
If the text is being composed, the result of undo will effectively remove the text. But keyboard app does not seem to accept the text change from editor. Probably we should restart input method when there is a change to the composition text, as suggested in issue 681519.
,
May 10 2017
Oops, I misread the steps. Actually, this works as expected. I suspect that the reason is that the changes came from the keyboard as Te -> Tes -> Test in the first place. Keyboard apps are usually multi threaded to be responsive to the user input while it can talk to editor apps asynchronously. So if you type 'Test' quickly enough, keyboard app may send 'Te' at once. One small noticeable issue here is that sometimes the restructured characters get highlighted, which seems to be a side effect of the current implementation which happens to change selection before making the composition change.
,
May 10 2017
even if it is coming from keyboard, undo would still be broken for a user. But if it is because of the keyboard, then native views should have the same problem, I think. |
|||
►
Sign in to add a comment |
|||
Comment 1 by sgu...@chromium.org
, Mar 31 2017