feathersui / feathersui-starling

User interface components for Starling Framework and Adobe AIR
https://feathersui.com/learn/as3-starling/
Other
915 stars 386 forks source link

When you change the location of a textinput, the focus disappears #1714

Closed denisgl7 closed 6 years ago

denisgl7 commented 6 years ago
messageInput.addEventListener( FeathersEventType.FOCUS_IN, input_focusInHandler );
private function input_focusInHandler(e:Event):void
{
    var layoutData:AnchorLayoutData = messageInput.layoutData as AnchorLayoutData;
    layoutData.bottom = _data.keyboardHeight ;
}

If you click on the textinput, the focus is lost while changing the location of the textinput On this link there is a preview video of what is happening. In January, I released the app with the same logic and everything worked well http://dropmefiles.com/OFsIg

joshtynjala commented 6 years ago

Which ITextEditor are you using? Were you using the same ITextEditor in the old version? Did you change the AIR version too, and does the issue reproduce with the old AIR version?

denisgl7 commented 6 years ago

StageTextTextEditor in both cases the problem is reproduced in air 29, 28. I will try to download the old version. In 28 earlier I didn't see any problems but there were new updates TextFieldTextEditor same situation

denisgl7 commented 6 years ago

The problem is not in the Air I launched the app with 3.4.0-beta and everything works fine!

joshtynjala commented 6 years ago

I couldn't figure out exactly what changed between 3.4.0-beta and now. It's possible that the FocusManager wasn't enabled in your app with that version and now it is with the latest code.

Regardless, I figured out that the StageTextTextEditor wasn't assigned focus if the TextInput moves between TouchPhase.BEGAN and TouchPhase.ENDED, and the FocusManager is enabled (it's fine when disabled). I added a workaround for this situation.

denisgl7 commented 6 years ago

Thank You Josh!