Can you please file a bug at http://bugs.adobe.com/flex/ and include your test 
case and we can take a look.

Peter



From: [email protected] [mailto:[email protected]] On Behalf 
Of johanlopes
Sent: Tuesday, April 27, 2010 11:20 AM
To: [email protected]
Subject: [flexcoders] Flex 4 RichEditableText component ignores multipe space



I have a use case where we have two Flex 4 RichEditableText components. (Using 
the latest public Flash Builder 4; Flex 4 SDK version: 4.0.0.14159).

One of the component is bound to the other's 'text' property through 
TextConverter.importToFlow.

The problem is, after hitting the space key on the keyboard more than once, the 
whitespace is shown only once on the other RichEditableText component. It 
seems, the TextConverter.importToFlow stops updating and ignores the second and 
all subsequent space on the other text component. When we trace the 
TextConverter.importToFlow(editor.text, TextConverter.TEXT_FIELD_HTML_FORMAT) 
value, we can see multiple break tags as html, but the component displays only 
one of them.

What are we doing wrong? Is this even possible using the Spark components? 
Please note that this is not a simple matter of changing to a simple 2-way 
binding between these two components. Our use case dictates that we use 
TextConverter.importToFlow as we're working with a server-side model.

How to reproduce:

1. Place the cursor between "Test Test" and hit "Backspace" on your keyboard.

2. See how the two components now both display "TestTest".

3. Place the cursor between "TestTest" and hit the space key on your keyboard 
once, hit it twice,,,, Now see how the other component stops updating to show 
the space between "Test Test" after only the first space.

Result:

"Test Test"

Expected result (after hitting the space key twice):

"Test Test" on both text fields.

Code:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009";
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Script>
<![CDATA[
import flashx.textLayout.conversion.TextConverter;
]]>
</fx:Script>

<s:HGroup horizontalCenter="0" verticalCenter="0">

<s:RichEditableText id="editor" text="Test Test" whiteSpaceCollapse="preserve" 
/>

<s:RichEditableText textFlow="{TextConverter.importToFlow(editor.text, 
TextConverter.TEXT_FIELD_HTML_FORMAT)}" whiteSpaceCollapse="preserve" />

</s:HGroup>

</s:Application>

Any pointers welcome.

Reply via email to