New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 599374 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Apr 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

Newest versions of chrome and webview remove the keypress javascript event from being fired on galaxy s5

Reported by jeremy.g...@gmail.com, Mar 31 2016

Issue description

Steps to reproduce the problem:
1. Create an event that fires on keypress
2. Notice that it doesn't get fired on Galaxy s5 in chrome or apps using webview

What is the expected behavior?
The event should fire

What went wrong?
The event didn't fire

Did this work before? Yes Sometime before this version

Chrome version: 49.0.2623.105  Channel: stable
OS Version: 5.0
Flash Version: 

It seems like this is a recurring issue since I've seen a bunch of older bug reports about the same thing. Should we just use a different event? The problem is there are benefits to using keypress as opposed to keydown and keyup events. Is there a reason this keeps recurring?
 
Components: Mobile>WebView
Cc: dtapu...@chromium.org
Components: -Blink Blink>Input
keypress events are deprecated events in the UI Events spec; they are only provided for compatibility.

Can you provide more details of your app. For example; what do you mean by create an event that fires on keypress? You mean bind a listener on keypress? Or are you somehow injected keyboard events in your webview's container?

You really should look at using the composition events.
Cc: aelias@chromium.org
Yeah, this bug report is vague.  What is the Javascript and what is the user interaction you're expecting to trigger the Javascript?

FWIW, soft onscreen keyboard is not considered pressing keys at all, it's an IME composition.  You should listen to mutation or composition events for that.  If you connect a physical keyboard to your Android device, you should see the keypress event.
I am using the following library: https://github.com/laurihy/angular-payments
It binds an event to the input fields for credit cards to format the text as you type so that if you are entering a visa after every four digits there will be a space. It also does the same for expiration date to put a slash between month and year. It seems to work on other phones with a touch keyboard just not the s5, but if it's deprecated I can use another event. What would you suggest? It uses the e.which but for keydown and keyup they come up incorrectly sometimes when converting the number to a char
Owner: changwan@chromium.org
Status: Assigned (was: Unconfirmed)
OK.  You mean you've tried it on other Android phones with the same Chrome version and it works there?  We can investigate the S5-specific behavior difference.
Cc: yabinh@chromium.org
Status: WontFix (was: Assigned)
http://www.cvilletaxi.com/wp-content/plugins/limolabs-icabbi/bower_modules/angular-payments/example/

The above URL seems to be an example using angular-payments.

For single line forms, Google keyboard seems to commit texts so that text change can occur immediately with regard to the keys. Samsung Keyboard seems compose texts even when it's a single line form (see the underline when you type a number). There's nothing wrong about Samsung Keyboard itself, it's just behave slightly differently.

In your case, I believe you can just listen to keyup event (which should always happen later than compositionupdate), and then change element.value as necessary. Here's example javascript write-up:

https://jsfiddle.net/galmacky/pz7dnnLj/2/

Sign in to add a comment