Threaded View
-
15 Aug 2011 9:02 PM #1
Focus on TextField breaks when using sencha.
Focus on TextField breaks when using sencha.
I know this has been talked about before I've looked at some post but it seems that when I load the sencha js file the focus stops working. Here is a small sample that is only using basic HTML.
A quick test you will see that focus does not work in Mobile Safari.
However removing the sencha-touch.js script focus works as expected when you click on the buttons, this is what desired function.
Code:<html> <head> <meta charset="UTF-8" /> <title>TEST</title> <script type="text/javascript" src="sencha-touch.js"></script> </head> <body> <input type="text" id="test"><br> <button onclick="document.getElementById('test').focus();">focus</button> <button onclick="document.getElementById('test').blur();">blur</button> <div id="button2container"></div> <script type="text/javascript"> var button = document.createElement('button'); button.innerHTML = 'focus (dynamic)'; button.onclick = function() {document.getElementById('test').focus();}; document.getElementById('button2container').appendChild(button); var button2 = document.createElement('button'); button2.innerHTML = 'focus (timeout)'; var focusFn = function() { document.getElementById('test').focus(); }; button2.onclick = function() { window.setTimeout(focusFn, 1); }; document.getElementById('button2container').appendChild(button2); </script> </body> </html>
How can this be fixed, since it is working without sencha touch js file.
Any ideas?
Thanks,
Ed
Looks like we can't reproduce the issue or there's a problem in the test case provided.


Reply With Quote