Selecting autocomplete suggestion for form input element fires keydown event with event.key undefined.
Reported by
sjom...@gmail.com,
Nov 12
|
|||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.44 Safari/537.36 Steps to reproduce the problem: 1. Navigate to https://jsfiddle.net/SamMiller/wf7sbenk/ This is an example of a form with one input element. There is some javascript listening to keydown events. If event.key is null/undefined, event.key, event.keyCode, and event.which are printed to the console. 2. Open the dev console. 3. Type something into the input box like "Hello" 4. Hit enter. The result should disappear because jsfiddle has submitted the form. 5. Click into the empty input, a drop down should appear with "Hello" as one of the suggestions. 6. Click on the "Hello" suggestion 7. The console will show: key:undefined keyCode:undefined which:undefined Note, you can also reproduce this problem using the keyboard. Click into the input box, use the keyboard to select the "Hello" autocomplete suggestion, press enter. What is the expected behavior? A keydown event should not fire if the mouse was used to click the autocomplete suggestion. If the keyboard was used to select the suggestion, a keydown event should fire, and it should contain the key that was pressed (i.e., the enter key). What went wrong? A keydown event does fire erroneously in the case when the mouse is used to click the autocomplete suggestion, and without any useful information in it (like key, keyCode, and which) when the keyboard is used to select the autocomplete suggestion. Did this work before? N/A Does this work in other browsers? N/A Chrome version: 71.0.3578.44 Channel: beta OS Version: 10.0 Flash Version: This is not reproducible in Firefox, and I can't test this in Edge because it doesn't seem to have an autocomplete feature for input boxes.
,
Nov 15
Thanks for the issue... Tried to reproduce the issue on reported chrome 71.0.3578.44 using windows 10. Attaching screencast for reference. Steps: ----- 1. Launched chrome 2. Opened given jsfiddle https://jsfiddle.net/SamMiller/wf7sbenk/ and opened Dev console 3. Clicked on text field and entered text and clicked on enter observed disappeared 4. Clicked on text field and selected text As we have observed that on the dev console > key:undefined, keyCode:undefined, which:undefined @Reporter: Could you please check the attached screen cast and let us know if anything missed from our end. Thanks..!
,
Nov 15
Nothing missing as far as I can see. The screencast shows the bug being correctly reproduced. Thanks.
,
Nov 15
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Nov 15
I suspect this may be intended as autofill fires key events in order to simulate a user "typing" - some pages listen for key events on the forms. Over to autofill team.
,
Nov 16
Able to reproduce the issue on the reported chrome 67.0.3396.99,latest canary 69.0.3486.0 using Windows 10, Mac 10.14.0 and Ubuntu 17.10. Below is the bisect information for same. Bisect Info: ================ Good build: 64.0.3253.0 Bad build: 64.0.3254.0 CHANGELOG URL: You are probably looking for a change made after 512552 (known good), but no later than 512553 (first known bad). https://chromium.googlesource.com/chromium/src/+log/dcda35961fbbe8484a8d073e5a802b1fe9bb25ae..018bf76b5eb54811482aff02d07c14f4e1ce3c36 Suspect: https://chromium.googlesource.com/chromium/src/+/018bf76b5eb54811482aff02d07c14f4e1ce3c36 Reviewed-on: https://chromium-review.googlesource.com/734104 sebsg: Please confirm the issue and help in re-assigning if it is not related to your change. Thanks!
,
Nov 26
Comment#5 is correct. There a lots of site that listen to keydown events for validation. Before we started sending those, an example of a problematic situation was a user that fills and presses submit, but the the JS validation would not let it submit. I thought that sending a particular key could be misleading. Would it be useful to send something else? |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by phanindra.mandapaka@chromium.org
, Nov 12