mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
Remove MouseEvent.button polyfill (#9334)
MouseEvent.button is supported in every browser React targets: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
This commit is contained in:
1 parent
3829859e22
commit
d99b3fc6d6
1 file changed
+1
-14
@@ -31,20 +31,7 @@ var MouseEventInterface = {
|
||||
altKey: null,
|
||||
metaKey: null,
|
||||
getModifierState: getEventModifierState,
|
||||
button: function(event) {
|
||||
// Webkit, Firefox, IE9+
|
||||
// which: 1 2 3
|
||||
// button: 0 1 2 (standard)
|
||||
var button = event.button;
|
||||
if ('which' in event) {
|
||||
return button;
|
||||
}
|
||||
// IE<9
|
||||
// which: undefined
|
||||
// button: 0 0 0
|
||||
// button: 1 4 2 (onmouseup)
|
||||
return button === 2 ? 2 : button === 4 ? 1 : 0;
|
||||
},
|
||||
button: null,
|
||||
buttons: null,
|
||||
relatedTarget: function(event) {
|
||||
return event.relatedTarget ||
|
||||
|
||||
Reference in new issue
Block a user