Skip to main content

Bug Tracker

Side navigation

#6262 closed bug (duplicate)

Opened March 11, 2010 10:19AM UTC

Closed September 08, 2011 07:24PM UTC

Last modified September 08, 2011 07:24PM UTC

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

Attachments (0)
Change History (8)

Changed November 12, 2010 02:40AM UTC by snover comment:1

milestone: 1.4.3

Resetting milestone to future.

Changed November 19, 2010 10:12PM UTC by snover comment:2

priority: → low
status: newopen
version: 1.4.21.4.4

Changed March 31, 2011 07:37PM UTC by dmethvin comment:3

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.

Changed April 17, 2011 05:38PM UTC by john comment:4

milestone: → 1.next
priority: lowhigh

Changed July 12, 2011 03:37PM UTC by john comment:5

Confirmed in bug triage.

Changed September 08, 2011 04:48PM UTC by dmethvin comment:6

_comment0: 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.1315506113232956
priority: highlow

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.

Changed September 08, 2011 07:24PM UTC by dmethvin comment:7

resolution: → duplicate
status: openclosed

Grouping under one ticket.

Changed September 08, 2011 07:24PM UTC by dmethvin comment:8

Duplicate of #7061.