#6262 closed bug (duplicate)
handlers for .submit() fired in bad order in IE6
Reported by: | jos | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | event | Version: | 1.4.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
in jQuery 1.4 was fixed bubbling of submit event in IE6, but submit event bubbles in strange order through DOM
following example alerts "body.submit", "html.submit", "submit.1", "submit.2"
$('html').submit(function(event) { alert('html.submit'); return true; }); $('body').submit(function(event) { alert('body.submit'); return true; }); $('form') .submit(function(event) { alert('submit.1'); return true; }) .submit(function(event) { alert('submit.2'); return true; }) ;
order of binding does not matter, result is always the same; in FF 3.6 works fine ("submit.1", "submit.2", "body.submit", "html.submit")
IE version: 6.0.2900.5512.xpsp_sp3_gdr.091208-2036
Change History (8)
comment:1 Changed 13 years ago by
Milestone: | 1.4.3 |
---|
comment:2 Changed 13 years ago by
Priority: | → low |
---|---|
Status: | new → open |
Version: | 1.4.2 → 1.4.4 |
comment:3 Changed 12 years ago by
This is due to the simulated bubbling of submit events in IE. We'll have to see if it's possible to fire them in the correct order, but if not at least it bubbles so .live()
and .delegate()
can work.
comment:4 Changed 12 years ago by
Milestone: | → 1.next |
---|---|
Priority: | low → high |
comment:6 Changed 12 years ago by
Priority: | high → low |
---|
I've looked at this but I don't see an easy way to fix it. One solution is to have IE's submit
special-event handler check for the existence of bound events via jQuery.data(event.target.form, "events").submit
and then set a flag to defer the bubbling of the delegated submit
event until after the bound events run. That requires an additional "post-handle()-run" special events hook and I don't know that it's worth all the work and code size for an edge case on old IE browsers.
See also #7061.
comment:7 Changed 12 years ago by
Resolution: | → duplicate |
---|---|
Status: | open → closed |
Grouping under one ticket.
Resetting milestone to future.