1

I have a number field. I want to select the text whenever the user touches it, so I handle its focus event. In the event call back function, I have call select function as below:

init : function() {
    this.control({
        'firstScreen #inputFieldSet numberfield' : {
            focus : this.onPowerFieldGotFocus,
            tap :this.keyPressed,
            keyup : this.onTextChange
         }
    })
 },
 onPowerFieldGotFocus : function(test, test2, obj) {
     test.select();
 }

I do it like this as I don't want my users to have to press the delete button again and again when they want to change the existing value in number field. Once they touch the TextField they can simply start writing to add the new value. It is working perfectly on most of the Android devices but not working on HTC devices. Very strange to me!! Can anyone provide a work-around? I am using Sencha Touch 2.

Blumer
  • 5,005
  • 2
  • 33
  • 47
Gem
  • 1,516
  • 16
  • 21
  • Have you tested the keydown method to see if that works? – Jeff Wooden Oct 12 '12 at 03:53
  • I have not found any keydown method for "numberfield" there is only keyup method. And it is not actually a method it is event. I am following sencha touch documentation: http://docs.sencha.com/touch/2-0/#!/api/Ext.field.Number Please correct me if i am on wrong path. – Gem Oct 12 '12 at 11:40
  • Your correct, i was on a 39 hour programming binge for a client, so my brain was a bit cloudy... at this point i would try and create a simple html form outside of ST2... if the issue still exists then its an HTC issue... if it works then its either an ST2 bug or something in your code causing the issue... – Jeff Wooden Oct 12 '12 at 18:52
  • Let me know what ever it is either htc bug or ST2 bug. But what it looks that it should not be from htc phones issue. As it is very general feature in any browser that user able to select the text written in input field. So most probably it is issue with ST2. If you feel that my code also impact this feature then let me know i will share my code here. – Gem Oct 14 '12 at 20:38
  • Go here on your HTC device and test to see if the number field works as expected: http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_input_type_number – Jeff Wooden Oct 15 '12 at 18:44

0 Answers0