When are you setting that flag?
In the creationComplete handler of the class that contains the textArea.
I guess you’ll have to debug into it. Could a theme switch or other code be replacing the skin on the TextArea after creationComplete?
No skins applied.
You can see the same behaviour here:
Just scroll down to the example, write something in the first TextArea, then switch focus to the other one, then click back on the first one and try to undo what you previously did (CTRL-Z). Nothing is undone/redone.
If the TextArea doesn't lose focus, you can undo/redo as usual.
You can see the source code there as well. No skins are applied.
Default behavior is to reset undo on focusOut, so the example works as expected. What isn’t clear is whether your flipping of that undocumented flag is known to work or not. I took a quick look at the code and it definitely alters a code path, but maybe UndoManager has its own focusOut logic.
Well the default behavior is the probelm.
Doesn't really make any sense, why dump the undo operations?
All they do is store links to objects, which should be dumped on object deletion, not focus loss.
It's a normal thing for a user to write something in a text field, then press a button / use another control, then go back to the text field and try to undo.
Is there a way to overwrite this default behavior?
Didn't find anything related in the UndoManager source code, so it's probably hiding in the spark.TextArea code.
Yeah, I was unaware of the default behavior. I’m surprised it clears on focusOut. That flag you found looks like it should do the trick and I don’t know why it doesn’t. I’ll try to find time to look. What version of Flex are you using?
I'm using 4.6
Thank you for your attention.
Looks like it saves text deletion/insertion operations.
When i try to change the format (bold/italic/font etc.) , not only does it ignore these changes, it removes all previously saved operations (deletion/insertion).