Skip navigation
Currently Being Moderated

UndoManager loses the list of undo/redo commands when TextArea is focused out.

Mar 1, 2013 6:08 AM

Tags: #textarea #spark #tlf #undomanager

Good day.

I'm struggling with the TLF UndoManager. All is well when working only with the text component, but when it loses focus, and then gains it back, i cannot undo/redo anything.

I've seen someone post a backdoor with

use namespace mx_internal;
                              RichEditableText(textArea.textDisplay).clearUndoOnFocusOut = false;

But it does not help, nor does it give an error.


Currently implementing my own UndoManager and just silencing the built-in one, but still hoping to make this work and not re-invent the wheel.

If anyone has encountered this problem, can you please show me the solution?

  • Currently Being Moderated
    Mar 1, 2013 3:11 PM   in reply to LucasAlex

    When are you setting that flag?

    Mark as:
  • Currently Being Moderated
    Mar 4, 2013 7:54 AM   in reply to LucasAlex

    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?

    Mark as:
  • Currently Being Moderated
    Mar 4, 2013 9:07 AM   in reply to LucasAlex

    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.

    Mark as:
  • Currently Being Moderated
    Mar 4, 2013 11:14 AM   in reply to LucasAlex

    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?

    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points