开发者

Remove line breaks from pasted text in Spark TextArea

开发者 https://www.devze.com 2023-03-03 05:58 出处:网络
I\'m trying to remove all line breaks from the text that is pasted into the Spark TextArea. I have: <s:TextArea id=\"inputSearchQuery\"

I'm trying to remove all line breaks from the text that is pasted into the Spark TextArea.

I have: <s:TextArea id="inputSearchQuery" width="100%" height="22" minHeight="22" maxHeight="196" changing="onInputSearchQueryChanging(event)"/>

And handler:

private function onInputSear开发者_如何转开发chQueryChanging(evt:TextOperationEvent = null):void {
    if (evt.operation is PasteOperation) {

    }
}

Where can I find a text that user pasted? As I understand, this text should be in evt.operation.textFlow but it is not... I'm confused.


Pasted text is in (evt.operation as PasteOperation).textScrap. So you can extract text from textScrap.textFlow.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号