Reputation: 17870
I have a mobile application that has a Text Input used for searching. Below the search TextInput is a StageWebView. When I set the source of the StageWebView using loadURL() the key input is shifted to the StageWebView.
How can I prevent this?
Upvotes: 1
Views: 1043
Reputation: 17870
I think I figured out the problem. When you set the stage property (which is basically setting the visibility to true) that's when it steals the focus. I was showing and hiding the web view depending on if the text input had any text (I was updating the webview source on text change). The fix was to set the web view to visible before putting the cursor in the Text Input. As long as the visibility doesn't change the focus stays in the text input.
Upvotes: 1
Reputation: 7935
I dont know if there is a better way but my solution is to try to set the focus back to the textInput by using myText.setFocus()
after your load routine.
Upvotes: 0