using WebView.evalJS and lost focus (android)

You must Login before you can answer or comment on any questions.

Hy,

i will develop a eventhandling for external pages (because external pages dosnt includes the Titanium namespace).

The problem is (only tests on android emu/device) when i call my getEvents function by the webView.evalJS then the webview lost the focus (or somthing else) from elements like inputs.

I debugged this problem ... the focus on the input is right and the focus on the webview is set but i cant write text in the input and the cursor don't blink.

see code:

var tabGroup = Titanium.UI.createTabGroup();
var win = Titanium.UI.createWindow({
    title:'win_test'
});
var webView = Titanium.UI.createWebView();
win.add(webView);
webView.url = 'test.html';
intervalFunc = function(){
    var r = webView.evalJS(
        'getEvents()'
    );
}
var tab = Titanium.UI.createTab({
    icon:'',
    title:'Test',
    window:win       
});
var interval = setInterval(intervalFunc, 2000);
tabGroup.addTab(tab);
tabGroup.open();
and the html file like:
<html>
<head>
    <title>blubb</title>          
</head>
<body>
<input type="text" value="test" name="testName">
<script type="text/javascript">
getEvents = function(){    
    return "";
}
</script>   
</body>
</html>
how i can create a issue for core developers ? :) when thats not an error of my side.

thx -- Thomas

— asked 2 years ago by Thomas Reitel
3 Comments
  • I'm having the exact same problem, using the 11 October 2011 CI build. Has anybody else seen the problem or managed to work around it?

    — commented 2 years ago by Ryan Asleson

  • I am having this same exact issue as well. I am unable to type in a textfield in an embedded WebView HTML form.

    Seems possibly related to this Android bug:
    http://code.google.com/p/android/issues/detail?id=7189

    — commented 2 years ago by Vance Lucas

  • I'm having the same issue. Has anyone found a solution?

    — commented 4 months ago by Lawrence Mishkin

Your Answer

Think you can help? Login to answer this question!