Prevent Keyboard get hidden on done button press


#1

Hi all,
I used following directive to focus to next field, on keyboard done button press. although i used event.preventDefault(); keyboard is getting hide.so how can i prevent keyboard get hidden on done button press.

.directive(‘tabPress’, function () {
return function(scope,element,attrs){
element.bind(“keypress”,function(event){
if(event.which===13){
event.preventDefault();
event.stopPropagation();
//return false;
var fields=$(this).parents(‘form:eq(0),body’).find(‘input, textarea, select’);
var index=fields.index(this);
if(index> -1&&(index+1)<fields.length)
fields.eq(index+1).focus();
//event.preventDefault();
}
});
};
});