[Webkit-unassigned] [Bug 226148] New: window.onkeydown event.target returns html element when focused on checkbox input element

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat May 22 17:21:39 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=226148

            Bug ID: 226148
           Summary: window.onkeydown event.target returns html element
                    when focused on checkbox input element
           Product: WebKit
           Version: Safari 14
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: jab_creations at yahoo.com

Created attachment 429442

  --> https://bugs.webkit.org/attachment.cgi?id=429442&action=review

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210523/21d0373b/attachment-0001.htm>


More information about the webkit-unassigned mailing list