15 Aug 2011 9:02 PM #1
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.
How can this be fixed, since it is working without sencha touch js file.
16 Aug 2011 4:11 PM #2
I'm assuming that you use some sort of onReady() method to launch your touch code. Could you simple focus on the text box from there?
I'll have to investigate further on the root of the issue to give you the answer of "why".
16 Aug 2011 4:37 PM #3
Yes my Sencha Touch code uses the onReady feature, and focus does not work no matter where it gets initiated from, either a touch start or click event. Ounce you add the sencha js file focus will no longer work, no matter how you try to do it.
I just removed everything from my original sencha code and created a basic sample to illustrate that by just adding the js file it will break focus after button press on mobile safari. From my understanding mobile safari focus works as long as it's initiated from a touch even, like a button click.
Try the code above and by simple removing the sencha js file, the focus will work in mobile safari.
I did noticed that when using sencha and I tried to set focus, it will actually clear placeHolder text and looks like it was starting to do the focus but it never finishes.
16 Aug 2011 10:07 PM #4
Ok, so if I understand you correctly, you're only seeing this issue in Safari Mobile?
It works fine for me in OSX 10.6.8 in both Chrome and Safari, but obviously that's not the browser in which you're noting the problem. I'm not familiar enough with the specifics of that browser so I can't tell you if the issue is a bug or not.
I'm obviously not the person who needs to help you here. If you haven't done so already, please submit a ticket to support.sencha.com where the issue can be properly escalated. Once you've done that, I can try to apply some pressure to get you an answer.
16 Aug 2011 11:40 PM #5
Yes the issues is only when running this on an iPad or iPhone with safari browser, other than that it works fine on desktop safari. I guess enter this as a bug?
17 Aug 2011 9:15 AM #6
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
Have you tried doing this all with Sencha Touch code?Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services email@example.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.