Bug Tracker

Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#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 9 years ago by snover

Milestone: 1.4.3

Resetting milestone to future.

comment:2 Changed 9 years ago by snover

Priority: low
Status: newopen
Version: 1.4.21.4.4

comment:3 Changed 8 years ago by dmethvin

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 8 years ago by john

Milestone: 1.next
Priority: lowhigh

comment:5 Changed 8 years ago by john

Confirmed in bug triage.

comment:6 Changed 8 years ago by dmethvin

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.

Last edited 8 years ago by dmethvin (previous) (diff)

comment:7 Changed 8 years ago by dmethvin

Resolution: duplicate
Status: openclosed

Grouping under one ticket.

comment:8 Changed 8 years ago by dmethvin

Duplicate of #7061.

Note: See TracTickets for help on using tickets.