Skip to content

Commit

Permalink
Fix #10567. Make sure quickIs matches correct class name.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmethvin committed Oct 24, 2011
1 parent 09c089a commit ee3eb6c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var rnamespaces = /\.(.*)$/,
// 0 1 2 3 4 5
// [ _, tag, id, class, attrName, attrValue ]
quick[1] = ( quick[1] || "" ).toLowerCase();
quick[3] = quick[3] && new RegExp( "\\b" + quick[3] + "\\b" );
quick[3] = quick[3] && new RegExp( "(?:^|\\w)" + quick[3] + "(?:\\w|$)" );
}
return quick;
},
Expand Down
8 changes: 8 additions & 0 deletions test/unit/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -2452,6 +2452,14 @@ test("delegated events quickIs", function() {
markup.find( "b" ).attr( "devo", "NO" );
check( "b", "b|[devo='NO'] p|.D" );

markup
.on( "blink", ".tricky", function() {
ok( false, "triggered on wrong class name match" );
})
.find( "p" )
.attr( "class", "tricky-match" )
.trigger( "blink" );

markup.remove();
});

Expand Down

0 comments on commit ee3eb6c

Please sign in to comment.