0
votes

I'm writing a veeeeeeeery simple code where a Spark TextArea is in a TabNavigator and I want to write something into it dynamically. The problem is: when I try to do it the TextArea stays white until clicking on it makes the text appear magically.

The mxml is this: http://pastebin.com/7WqvXuH2

and very simple code to write is this:

xmlError.text += error+"\n\n";

I also tried this but with the same result

xmlError.appendText(error+"\n\n");

Hope I've been clear.

1
Is this related to mobile, I've seen this issue myself as well on mobile devices but so far not on the desktop, with regard to the mobile devices I believe it's a bug somehow related to using stage text, I've worked around it by setting focus as soon as the view is activated. - shaunhusain
posting as an answer since it's code even though my guess is there's gotta be a better way. - shaunhusain

1 Answers

1
votes

As a work-around I've used the code below, there are multiple input fields on this view setting the focus on just one of the text inputs causes all of them to render the text correctly.

The only really relevant "property" is the creationComplete handler.

        <s:TextInput autoCapitalize="none"
                     autoCorrect="false"
                     creationComplete="{tiFirst.setFocus()}"
                     id="tiFirst"
                     prompt="{data.firstName}"
                     text="{data.firstName}"
                     width="300"
                     tabIndex="0"/>