Ticket #11793 (closed bug: duplicate)
trigger('change') on a disabled input do not trigger filtered listener .on('change', 'input', ...)
| Reported by: | pierre.gotab@… | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | None |
| Component: | unfiled | Version: | 1.7.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Let $input be a disabled input in a $form. A call to $input.trigger('change') wont fire a listener set up with $form.on('change', 'input', function(){...}) but will fire a listener set up with $form.on('change', function(){...}).
Change History
comment:1 Changed 13 months ago by dmethvin
- Status changed from new to closed
- Resolution set to duplicate
comment:3 Changed 13 months ago by anonymous
What I understand from the duplicate state is that jQuery is consistent with the (incredibly retarded) fact that some browsers do not trigger some events on disabled inputs (mouse events and - apparently - change events).
But a listener set on a parent can catch the 'change' event so this event is actually created and bubbled?!
Finally, t seems like:
.on(type, selector, function)
is different from:
.on(type, function(evt){ if(!$(evt.target).is(selector)) return; ... })
in this situation. Not a really clear behavior... and not documented in http://api.jquery.com/on/
Besides, the W3C never said that events don't fire on disabled inputs, and the note at the end of http://www.w3.org/TR/html4/interact/forms.html#h-17.12.1 let us think that scripts can operate on disabled inputs and therefore events should fire and bubble normally. I hope jQuery goal is not to conform to creepy browser's implementations but to offer to the javascript programmer a smart interface to that crap. Thank you for your work btw :)
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
