question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Input in Chrome on Android results in random characters being inserted

See original GitHub issue

Expected behavior

If I type “1234” with my options below I expect to see “1,234” in the field.

Actual behavior

On Chrome on Android, random digits get inserted as I am typing and the end result is “112.43”. I also have to go back into the numerical keyboard after typing the first “1”. I made a recording to showcase the issue: https://www.youtube.com/watch?v=1Zn4g-8MZpc

Steps to reproduce the problem

  1. Using autoNumeric 4.0.3 and the browser Chrome for Android version 63.0.3239.111 on Android 8.1.0,
  2. I used the options
{
	digitGroupSeparator: ",",
	decimalCharacter: ".",
	currencySymbol: "",
	currencySymbolPlacement: "p",
	decimalPlaces: 2,
	minimumValue: -999999999.99,
	maximumValue: 999999999.99,
	selectOnFocus: false,
	modifyValueOnWheel: false
}
  1. Initialized my AutoNumeric object with the call
new AutoNumeric(document.querySelector('#test'), {
	digitGroupSeparator: ",",
	decimalCharacter: ".",
	currencySymbol: "",
	currencySymbolPlacement: "p",
	decimalPlaces: 2,
	minimumValue: -999999999.99,
	maximumValue: 999999999.99,
	selectOnFocus: false,
	modifyValueOnWheel: false
});
  1. This seems to be happening both in master and in next branches

Link to live example

Very straightforward: https://codepen.io/anon/pen/VyMMKL

I will start digging into the AutoNumeric code to see what might be the cause as this is a critical issue for us. However, as this will be one of my first forays into that code, I wanted to get this issue out first so if anyone has any idea we can get this fixed sooner. Any hints are appreciated.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
AlexandreBonneaucommented, Jan 9, 2018

I do not recommend doing that, since you’d lose the main goal of AutoNumeric ; formatting as-you-type.

However if you want to go down this road, you could set the noEventListeners option to true (see the doc), and manually add an event listener on blur that calls the anElement.set(yourValue) method.

1reaction
AlexandreBonneaucommented, Jan 5, 2018

Additionally, if you want to dig in the AutoNumeric code, I’d suggest to take a look at the _onInput() method that handle key events on the Android platform (where the keycodes for every key equals 229…).

Also, check the event lifecycle doc for info and run yarn test:unitpp to be sure that your changes does not break the desktop.

Have fun 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google search app glitches when i begin typing. When I first ...
When I first open the google search app and start typing, after the first letter, the app glitches and the keybaord goes away...
Read more >
Weird characters like â are showing up on my site - Blog
Getting weird characters like  instead of or ’? ... It is for this reason that improperly-displayed UTF-8 results in weird characters.
Read more >
Detect and get rid of unwanted sneaky mobile redirects
Who implements these mobile-only sneaky redirects? There are cases where webmasters knowingly decide to put into place redirection rules for their mobile users....
Read more >
html - Disabling Chrome Autofill - Stack Overflow
The only current solution I can think of is to dynamically generate custom input names and then extract the values on the backend,...
Read more >
Known issues with Android Studio and Android Gradle Plugin
In some scenarios, the IDE stops responding to keyboard input or starts inputting random characters. This bug is triggered by some missing synchronization ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found