I am using iOS (havent tested on android) and the skinClass="spark.skins.mobile.TextInputSkin" and am having an issue when I go to enter text from the soft keyboard. When the text input is empty and I press on a key on the keyboard, that letter enters the text input but it gets highlighted right away by iOS and then the second letter I type overwrites the first. It just happens for the first letter. I tested the same setup on AIR 3.1 and it does not happen so I am thinking its a bug with 3.2
I have the same Problem: in some cases we have in TextInputs the bahaviour that every time I input a text the whole text in Textinput ist selected. This does only happen when I compile with Air 3.2 - if I use Air 3.1 everything works like expected. This does not happen in TextAreas and some other TextInputs in the same Application.
In case that the part of the Screen is scrolling where the TextInputs are I changed the skin to: spark.skins.mobile.TextInputSkin
Setup:
SDK: Air 3.2 / Flex 4.6 (combined)
compiled for iOS only, tested on iPad 2, iOS 5.1
using the e-skimo-lib for skinning (www.e-skimo.com) -> the Eskimo-Skin has been recompiled with the same SDK.
<fx:Script>
protected function testTextInput_changeHandler(event:TextOperationEvent):void
{
// do something
}
protected function testTextInput_focusOutHandler(event:FocusEvent):void
{
// do the same
}
</fx:Script>
<s:TextInput
id="testTextInput"
skinClass="spark.skins.mobile.TextInputSkin"
// did cause the problem:
change="testTextInput_changeHandler(event)"
// works for me
focusOut="testTextInput_focusOutHandler(event)"/>
The problem is somewhere in SkinnableTextBase. When textDisplay_changeHandler(event:Event) is called, invalidateSkinState() is what's causing the problem. If you set the skin's state to nothing (""), it works:
skin.currentState = "";
invalidateSkinState();
The problem is that your theme doesn't update properly.
Now is you set "showPromptWhenFocused" to false in your CSS, the problem doesn't happen. Only side effect is the prompt disapear if you have the textInput selected.
s|TextInput{
skinClass:ClassReference("spark.skins.mobile.TextInputSkin");
showPromptWhenFocused: false;
}
This is a complete hack, but it has made it possible to ship Air code on iOS with this issue.
We have created a control based on TextInput to use throughout our program that has a change event. In this change event we do something like the following:
if (this.text.length == 1 && flash.system.Capabilities.version.substr(0,3).toUpperCase() == "IOS")
{
this.insertText(this.text); //This does not fire the change event.
}
So, if the user presses a key, and there is only 1 key, that key will be doubled. This is not perceptible, so the selected text is immediately cleared with the same text. All characters added after the first work correctly.
Note that all of our TextInputs have a Prompt, so if scoregrid is correct, then this code should be changed to also check for Prompt text.
I don't know if this ever was solved for you, but my experience with similar problems is simply that iOS is too stupid -not- to shove a 'clear field' icon into the layout w/o resizing the component. I automatically make certain to add 50px to the width just to be extra certain the blasted thing doesn't obfuscate my text. Very very stupid thing to force people to do and there seems to be no programming logic as part of the component or mobile skin that lets you disable the icon or tell the component to recalculate the width automatically. If it's there, dragging through documentation and searching StackOverflow and the Adobe forums never exposed it to me.
North America
Europe, Middle East and Africa
Asia Pacific