mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
getModifierState is case sensitive
This commit is contained in:
@@ -25,10 +25,10 @@
|
||||
*/
|
||||
|
||||
var modifierKeyToProp = {
|
||||
'alt': 'altKey',
|
||||
'control': 'ctrlKey',
|
||||
'meta': 'metaKey',
|
||||
'shift': 'shiftKey'
|
||||
'Alt': 'altKey',
|
||||
'Control': 'ctrlKey',
|
||||
'Meta': 'metaKey',
|
||||
'Shift': 'shiftKey'
|
||||
};
|
||||
|
||||
// IE8 does not implement getModifierState so we simply map it to the only
|
||||
@@ -41,7 +41,7 @@ function modifierStateGetter(keyArg) {
|
||||
if (nativeEvent.getModifierState) {
|
||||
return nativeEvent.getModifierState(keyArg);
|
||||
}
|
||||
var keyProp = modifierKeyToProp[keyArg.toLowerCase()];
|
||||
var keyProp = modifierKeyToProp[keyArg];
|
||||
return keyProp && nativeEvent[keyProp];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user