Skip to content

Commit c611504

Browse files
committed
Fix #13143. Event target cannot be a text node.
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.
1 parent d2a51f0 commit c611504

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/event.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,12 @@ jQuery.event = {
470470
event[ prop ] = originalEvent[ prop ];
471471
}
472472

473+
// Target should not be a text node (#504, #13143)
474+
// Support: Chrome 23+, Safari?
475+
if ( event.target.nodeType === 3 ) {
476+
event.target = event.target.parentNode;
477+
}
478+
473479
return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
474480
},
475481

0 commit comments

Comments
 (0)