Skip to content

Signal handling is incorrect on android #279

@sparcbr

Description

@sparcbr

The minus key on android does not fire on key press event. So I used this code on key down event:

if ($.browser.device && key == 229) { // minus key on android
  var val = e.target.value;
  if ((val.match(/-/g) || []).length >= 1) {
	  val = val.replaceAll("-", ""); //remove signal
  } else {
	  if (settings.allowNegative) {
		  val = '-' + val; //add signal
	  }
  }
  setTimeout(function() { // need this because we can't use preventDefault on android
	  $input.val(val);
  }, 100);
  
  return false;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions