Defect #43488
openUndo/Redo produces unexpected results when the text in a textarea is modified automatically
0%
Description
When using the Wiki toolbar or keyboard shortcuts that modify text in a textarea, the undo/redo operations (Command/Control + Z and Shift + Command/Control + Z) behave inconsistently. They function, but the results are not what you would expect.
Here are some examples:- Applying bold using the Wiki toolbar :
Select part of the text and click the Bold button. After this action, both Command/Control + Z (undo) and Shift + Command/Control + Z (redo) behave in unexpected ways. - Applying italic using a keyboard shortcut :
Select part of the text and press Command/Control + I. After this action, both Command/Control + Z (undo) and Shift + Command/Control + Z (redo) behave in unexpected ways. - Automatic bullet insertion :
Create a bulleted list and press Enter to trigger automatic insertion of the next bullet point. After this action, both Command/Control + Z (undo) and Shift + Command/Control + Z (redo) behave in unexpected ways.
These behaviors occur when the Wiki toolbar, keyboard shortcuts, or auto-completion trigger JavaScript-based text modifications (i.e., changes not made through direct user input).
Such programmatic text changes may not be recorded in the browser’s native undo/redo stack as expected.
For example, when using APIs like setRangeText(...) or assigning to input.value=, the changes are not recognized as “user actions,” which leads to inconsistencies in the undo/redo history.
Reference: https://stackoverflow.com/questions/73129862/is-it-possible-to-undo-setrangetext
No data to display