for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {
- // Don't process events on disabled elements (#6911, #8165)
- if ( cur.disabled !== true ) {
+ // Don't process clicks (ONLY) on disabled elements (#6911, #8165, #xxxx)
+ if ( cur.disabled !== true || event.type !== "click" ) {
selMatch = {};
matches = [];
jqcur[0] = cur;
svg.remove();
});
-test("Delegated events in forms (#10844; #11145; #8165)", function() {
- expect(3);
+test("Delegated events in forms (#10844; #11145; #8165; #xxxxx)", function() {
+ expect(5);
// Alias names like "id" cause havoc
var form = jQuery(
form
.append( '<button id="nestyDisabledBtn"><span>Zing</span></button>' )
.on( "click", "#nestyDisabledBtn", function() {
- ok( true, "enabled/disabled button with nesty elements" );
+ ok( true, "click on enabled/disabled button with nesty elements" );
+ })
+ .on( "mouseover", "#nestyDisabledBtn", function() {
+ ok( true, "mouse on enabled/disabled button with nesty elements" );
})
- .find( "span" ).trigger( "click" ).end() // yep
+ .find( "span" )
+ .trigger( "click" ) // yep
+ .trigger( "mouseover" ) // yep
+ .end()
.find( "#nestyDisabledBtn" ).prop( "disabled", true ).end()
- .find( "span" ).trigger( "click" ).end() // nope
+ .find( "span" )
+ .trigger( "click" ) // nope
+ .trigger( "mouseover" ) // yep
+ .end()
.off( "click" );
form.remove();