RESOLVED INVALID 192621
messed up scope in eventHandler
https://bugs.webkit.org/show_bug.cgi?id=192621
Summary messed up scope in eventHandler
g. papa
Reported 2018-12-12 04:54:47 PST
On Chrome 71 (not on any Chrome before), if an element (select, button) has an inline onclick event with the id (of the element) specified as a parameter of the called function AND this element has children elements, the scope gets messed up and it tries to take the id of the child element. <select id="myselect" onclick="jsDoSomething(id)"><option>1</option><option>2</option></select> function jsDoSomething(id) { alert(id); } Stackoverflow report: https://stackoverflow.com/questions/53740067/chrome-71-does-not-detect-id-in-an-onclick-event-unless-its-this-id/53740954?noredirect=1#comment94335519_53740954
Attachments
Alexey Proskuryakov
Comment 1 2018-12-12 13:15:11 PST
Chrome has forked WebKit many years ago, so new bugs that appear there are Google's own. WebKit doesn't appear to even send a click event for selects, as I don't get any alert even after adding <script> around the code.
Note You need to log in before you can comment on or make changes to this bug.