Closed Bug 880689 Opened 12 years ago Closed 12 years ago

Disabled buttons does not receive custom events

Categories

(Core :: DOM: Events, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 329509

People

(Reporter: nekr, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.63 Safari/537.31 Steps to reproduce: Run this code: <button id="test" disabled></button> <script> var button = document.querySelector('#test'); button.addEventListener('test', function() { alert(123); }); button.dispatchEvent(new CustomEvent('test')); </script> Please test in real html file, not via data:text/html, ... Actual results: Nothing. Expected results: Custom event should be dispatched and alert displayed. In Chrome this works. Other browsers are not tested yet.
How to hack via JS: http://pastebin.com/EuvLfqkJ
Also found this bug in IE (tested IE10 on Window 7). But only Firefox fails with wrapped disabling. Some thing like this: <fieldset disabled> <button></button> </fieldset> In this case, events 'll not be dispatched on button element. Shim and test case are here: https://gist.github.com/NekR/5732319
Component: Untriaged → DOM: Events
Product: Firefox → Core
Yeah, this is known.
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.