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:
Nathan Hunzaker 2017-04-05 07:34:48 -04:00 committed by Dan Abramov
parent 3829859e22
commit d99b3fc6d6

View File

@ -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 ||