Dynamic changes in text input values are not registered by the undo history.
Reported by
manuelch...@gmail.com,
Jul 10 2017
|
||||||
Issue descriptionChrome Version : 59.0.3071.115 (Official Build) (64-bit) URLs (if applicable) : N/A Other browsers tested: N/A What steps will reproduce the problem? (1) Change the value dynamically on a text input. (2) Try to use undo normally. What is the expected result? Undo takes into consideration the dynamic changes. What happens instead? Undo doesn't take into consideration the dynamic changes. Here's a fiddle https://jsfiddle.net/apb5jrq3/2/ I understand this might be on purpose to avoid other issues. But at least on an application I'm developing, the way this works is problematic, since I change a lot of the inputs programatically, and the undo won't work properly when the user wants to revert a change.
,
Jul 11 2017
Yeah insertText works indeed. I guess this is not a problem, except that the input has to be focused which may cause issues in some applications.
,
Aug 6 2017
This is working in current Firefox. Using Firefox, in the fiddle click the Erase button to change the value. Now make an undo. The text is restored. https://jsfiddle.net/z8a9exep/
,
Aug 6 2017
It seems it only works if the undo is done while the textarea is focused though. And could be a side effect of other feature as well.
,
Sep 29 2017
@ manuelchaves-- Thanks for reporting the issue . Could you please confirm if you could reproduce the issue on latest stable M61 #61.0.3163.100. Thanks!
,
Sep 30 2017
@hdodda-- It now undos indeed. Although it seems to do it in chunks, like undo everything I typed or erased in a single chunk instead of per letter, even if taking some time between typing the letters. Not a problem in my case, since I ended up using the exec undo in my application.
,
Sep 30 2017
Thank you for providing more feedback. Adding requester "hdodda@chromium.org" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Oct 9 2017
@manuelchaves -- Can we close this issue based on the Comment#6. Thanks!
,
Oct 27 2017
,
Oct 30 2017
Mark WontFix since this is work as expected. Undo/Redo stack records only changes of Document#execCommand, including typing. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by woxxom@gmail.com
, Jul 11 2017This is working according to specification AFAIK. The solution is to focus the element and use document.execCommand('insertText', false, 'foo'), there's also 'insertHTML' for contentEditable elements and other commands.