[
https://issues.apache.org/jira/browse/FLEX-34033?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13867436#comment-13867436
]
Shigeru Nakagaki commented on FLEX-34033:
-----------------------------------------
I believe RichEditableText does not care about multiline property when text is
changed.
Here is commitProperties method of RichEditableText.
Please look at the line after the "if (textChanged)".
override protected function commitProperties():void
{
super.commitProperties();
updateStylesIfChanged();
var oldAnchorPosition:int = _selectionAnchorPosition;
var oldActivePosition:int = _selectionActivePosition;
// EditingMode needs to be current before attempting to set a
// selection below.
if (enabledChanged || selectableChanged || editableChanged)
{
updateEditingMode();
enabledChanged = false;
editableChanged = false;
selectableChanged = false;
}
// Only one of textChanged, textFlowChanged, and contentChanged
// will be true; the other two will be false because each setter
// guarantees this.
if (textChanged)
{
// If the text has linebreaks (CR, LF, or CF+LF)
// create a multi-paragraph TextFlow from it
// and use the TextFlowTextLineFactory to render it.
// Otherwise the StringTextLineFactory will put
// all of the lines into a single paragraph
// and FTE performance will degrade on a large paragraph.
if (_text.indexOf("\n") != -1 || _text.indexOf("\r") != -1)
{
_textFlow = staticPlainTextImporter.importToFlow(_text);
_textContainerManager.setTextFlow(_textFlow);
}
else
{
_textContainerManager.setText(_text);
}
> single-line TextInput keeps a newline when TextInput.text = "abc\n".
> --------------------------------------------------------------------
>
> Key: FLEX-34033
> URL: https://issues.apache.org/jira/browse/FLEX-34033
> Project: Apache Flex
> Issue Type: Bug
> Components: Spark: TextInput
> Environment: Windows 7
> Reporter: Shigeru Nakagaki
> Attachments: TextInput_keeps_newline.png, src.zip
>
>
> Is this right?
> <?xml version="1.0" encoding="utf-8"?>
> <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
> xmlns:s="library://ns.adobe.com/flex/spark"
> xmlns:mx="library://ns.adobe.com/flex/mx">
>
> <s:layout>
> <s:VerticalLayout />
> </s:layout>
>
> <fx:Script>
> <![CDATA[
>
> protected function button1_clickHandler(event:MouseEvent):void
> {
> txt.text = "abc\n";
> }
>
> ]]>
> </fx:Script>
>
> <s:TextInput id="txt"/>
> <s:Button label="set"
> click="button1_clickHandler(event)"/>
>
> </s:WindowedApplication>
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)