开发者

How to return the focus to a textInput in a browser

I need to focus a text input into the Facebook login popup. I am using a virtual keyboard to simulate a physical one, but when I click a 开发者_开发技巧key, the text input lose focus and the letter is not written into the field.

How could I maintain the focus in the text input?


I'm not sure if creating your own virtual keyboard is a smart idea since all mobiles already have one in there, you just need to set useSoftKeyboard in Flex.

Also, you can always remove focusability to your components by setting focusEnabled and hasFocusableChildren to false.


I finally came to another solution... Using getElementsByTagName('theElementID'), I could get a reference to the textInputs in the browser, and I could modify its attributes...

For example,

emailStringObject =this.html.htmlLoader.window.document.getElementById('email');
emailStringObject.value="example@correo.com"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜