Summary: | window.onkeydown event.target returns html element when focused on checkbox input element | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | John A. Bilicki III <jab_creations> | ||||
Component: | UI Events | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED DUPLICATE | ||||||
Severity: | Normal | CC: | akeerthi, ap, cdumez | ||||
Priority: | P2 | ||||||
Version: | Safari 14 | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Created attachment 429442 [details] Test case to easily demonstrate the bug and a small work-around. While this bug is simple how I came across it isn't so I will try to explain it as best as I can and produce a publicly accessible page so others can easily reproduce this bug. The window.onkeydown's event.target is returning the html element instead of the input checkbox element that was clicked. I sometimes get excessive test emails (e.g. working on a cron job) and sometimes my inbox is half-full with these emails so I can't use the check-all checkbox or obviously I'd select other emails that I do not want to delete. I spent some time earlier creating a script that when pressing the up or down arrow key will make the corresponding checkbox above or below match the window.onkeydown/event.target's checked state so I can select the emails I want to delete much faster than manually clicking on ~50 checkbox input elements. I've attached a test case that also includes a non-intuitive work-around. The input checkbox elements are NOT inside of label elements to reduce potential confusion. Blink/Chrome and Gecko/Waterfox/Firefox correctly reference the input element instead of the html element in this circumstance.