Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signal handling is incorrect on android #279

Open
sparcbr opened this issue Sep 6, 2024 · 1 comment
Open

Signal handling is incorrect on android #279

sparcbr opened this issue Sep 6, 2024 · 1 comment

Comments

@sparcbr
Copy link

sparcbr commented Sep 6, 2024

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;
}
@sparcbr
Copy link
Author

sparcbr commented Sep 10, 2024

Doesn't work on some samsung phones . The code is always 229 from the keypad on key down event :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant