Paste with empty clipboard inserts "null"
Flex 4.1
To reproduce :
Place cursor in textFlow, select nothing.
Copy
Paste
The text "null" is inserted instead of the expected "" empty string.
I've created a workaround, we can listen for paste events and manipulate the pasted content.
myTextFlow.addEventListener(FlowOperationEvent.FLOW_OPERATION_BEGIN, handleFlowEvents);
...
private function handleFlowEvents(e:FlowOperationEvent):void {
if (e.operation is PasteOperation) {
trapPaste(e.operation as PasteOperation);
}
}
private function trapPaste(po:PasteOperation):void {
var pasteTxtflow:TextFlow = po.textScrap.textFlow
pasteTxtflow.interactionManager = new EditManager();
if (pasteTxtflow.mxmlChildren.length == 1 && pasteTxtflow.getFirstLeaf().text == "null" && pasteTxtflow.getFirstLeaf() is SpanElement) {
(pasteTxtflow.getFirstLeaf() as SpanElement).text = "";
return;
}
}
