diff options
author | Dave Methvin <dave.methvin@gmail.com> | 2012-06-11 18:44:54 -0400 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2012-06-11 18:44:54 -0400 |
commit | f8c02c886efdf3e42819a960da28738e20bb7a48 (patch) | |
tree | ff788bfd74024c002c80441a8fd7b988f0e9cb79 | |
parent | 9e0c056171d1a5cac407f8fedbf926be91eaba1a (diff) | |
download | jquery-f8c02c886efdf3e42819a960da28738e20bb7a48.tar.gz jquery-f8c02c886efdf3e42819a960da28738e20bb7a48.zip |
Fix #11328. I've never metaKey I liked on IE 6/7/8.
The `event.metaKey` property is undefined there so we ensure it's set to `false` for lack of a better default. The `originalEvent.metaKey` property is untouched if you prefer to make other guesses about the platform or key state.
This is pretty much impossible to unit test since it is not only platform dependendent but also only executed for native browser events.
-rw-r--r-- | src/event.js | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/event.js b/src/event.js index 03049a5c4..bc08e4782 100644 --- a/src/event.js +++ b/src/event.js @@ -554,10 +554,8 @@ jQuery.event = { event.target = event.target.parentNode; } - // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8) - if ( event.metaKey === undefined ) { - event.metaKey = event.ctrlKey; - } + // For mouse/key events, metaKey==false if it's undefined (#3368, #11328; IE6/7/8) + event.metaKey = !!event.metaKey; return fixHook.filter? fixHook.filter( event, originalEvent ) : event; }, |