feathersui-starling icon indicating copy to clipboard operation
feathersui-starling copied to clipboard

TextInput: Changes to displayAsPassword moves cursor to the beginning

Open ffelini opened this issue 12 years ago • 3 comments

Hi. I would like to show the text in an TextInput on each user input action and after a delay to hide it again setting displayAsPasword to true; At the moment in debug emulator it works fine, but on the mobile device every displayAsPasword set call rest the cursor to the begining of the input. I an old version, something about 3-4 weeks ago this worked fine.

Source code public class PassInput extends TextInput { public var passHideDelay:Number = 400; public var showPassOnInput:Boolean = false;

    public function PassInput()
    {
        super();
        displayAsPassword = true;
    }
    override protected function textEditor_changeHandler(event:Event):void
    {
        super.textEditor_changeHandler(event);

        if(showPassOnInput) 
        {
            displayAsPassword = false;
            setTimeOutFunc(showPassword,passHideDelay,false);
        }
    }
    protected function showPassword(display:Boolean):void
    {
        displayAsPassword = !display;
    }

ffelini avatar Sep 06 '13 12:09 ffelini

I will look into this, but there may be no way to fix it without breaking something else. StageText has inconsistent behavior on different platforms, and that makes any changes I make likely to be unstable. For instance, I recently discovered that setting displayAsPassword will completely clear the text on some platforms, but not others. This behavior change may have happened as a result of the workaround I needed to use to fix that issue.

joshtynjala avatar Sep 06 '13 14:09 joshtynjala

At the moment in debug emulator it works fine, but on the mobile device every displayAsPasword set call rest the cursor to the begining of the input.

Is that on Android? On my iPad, the cursor remains in the same place, but the timeout never sets displayAsPassword back to true! Yet more inconsistent behavior, I guess, unless there's a silent runtime error that I didn't see because I wasn't in the debugger.

joshtynjala avatar Sep 06 '13 21:09 joshtynjala

yes... I tested on android only and what's interesting an older version of feathers worked fine in past maybe it is caused by the last commit on TextInput class?

ffelini avatar Sep 09 '13 07:09 ffelini