Skip to content

Commit

Permalink
Fix #13143. Event target cannot be a text node.
Browse files Browse the repository at this point in the history
Check removed in the initial 2.0 refactor but Chrome still needs it. No effective way to unit test; see the test case in #13143.
  • Loading branch information
dmethvin committed Jan 6, 2013
1 parent d2a51f0 commit c611504
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/event.js
Expand Up @@ -470,6 +470,12 @@ jQuery.event = {
event[ prop ] = originalEvent[ prop ];
}

// Target should not be a text node (#504, #13143)
// Support: Chrome 23+, Safari?
if ( event.target.nodeType === 3 ) {
event.target = event.target.parentNode;
}

return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
},

Expand Down

0 comments on commit c611504

Please sign in to comment.