Keypress event not working on Android device -


i have directive controls input value desired formatted or not.

directive('validnumber', function(sharedataservice)   {       return        {         require: 'ngmodel',         link: function(scope, element, attrs, ngmodelctrl)          {           if(!ngmodelctrl)            {             return;           }    ngmodelctrl.$parsers.push(function(val) {     if (angular.isundefined(val)) {         var val = '';     }     var clean = val.replace(/[^-0-9\.]/g, '');           var decimalcheck  = clean.split('.');     if(!angular.isundefined(decimalcheck[1]))     {         decimalcheck[1] = decimalcheck[1].slice(0,2);         clean = decimalcheck[0] + '.' + decimalcheck[1];     }      if (val !== clean)     {       ngmodelctrl.$setviewvalue(clean);       ngmodelctrl.$render();     }       return scope.hesapla(clean);   });    element.bind('keypress', function(event) {     if(event.keycode === 32) { // space       event.preventdefault();     }   });    element.bind('keypress', function(event) {     if(event.keycode === 45) { // - key       event.preventdefault();     }   }); }  }; }) 

it's working on browser keypress event not working on device.tried inspect device google chrome not firing. tried keyup or keydown still not working. how can done?

thank you

include jquery mobile file

what need include jquery file project. file named jquery.mobile.js or quite similar (ex. jquery.ui.js) of version can you.

you can download : download | jquery mobile


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -