Input in Chrome on Android results in random characters being inserted
See original GitHub issueExpected 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
- Using autoNumeric
4.0.3
and the browserChrome for Android
version63.0.3239.111
onAndroid 8.1.0
, - I used the options
{
digitGroupSeparator: ",",
decimalCharacter: ".",
currencySymbol: "",
currencySymbolPlacement: "p",
decimalPlaces: 2,
minimumValue: -999999999.99,
maximumValue: 999999999.99,
selectOnFocus: false,
modifyValueOnWheel: false
}
- 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
});
- This seems to be happening both in
master
and innext
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:
- Created 6 years ago
- Comments:6 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 totrue
(see the doc), and manually add an event listener onblur
that calls theanElement.set(yourValue)
method.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 equals229
…).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 😉