diff options
author | Dave Methvin <dave.methvin@gmail.com> | 2013-01-06 10:24:56 -0500 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2013-01-06 10:25:02 -0500 |
commit | c61150427fc8ccc8e884df8f221a6c9bb5477929 (patch) | |
tree | 3d9c7279132752365281bb29c640cdedd9b6a8bd /src | |
parent | d2a51f0e44ba50d9949e307e391801b22ccab638 (diff) | |
download | jquery-c61150427fc8ccc8e884df8f221a6c9bb5477929.tar.gz jquery-c61150427fc8ccc8e884df8f221a6c9bb5477929.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/event.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/event.js b/src/event.js index 733e563c2..da3ac312e 100644 --- a/src/event.js +++ b/src/event.js @@ -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; }, |