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
Nathan Hunzaker committed
Apr 5, 2017 at 07:34 UTC
d99b3fc6d6bd35306d0d23b635afd42dc3c20f05
1 file changed
+1
-14
src/renderers/dom/shared/syntheticEvents/SyntheticMouseEvent.js
+1
-14
@@ -31,20 +31,7 @@ var MouseEventInterface = {
31
altKey: null,
32
metaKey: null,
33
getModifierState: getEventModifierState,
34
- button: function(event) {
35
- // Webkit, Firefox, IE9+
36
- // which: 1 2 3
37
- // button: 0 1 2 (standard)
38
- var button = event.button;
39
- if ('which' in event) {
40
- return button;
41
- }
42
- // IE<9
43
- // which: undefined
44
- // button: 0 0 0
45
- // button: 1 4 2 (onmouseup)
46
- return button === 2 ? 2 : button === 4 ? 1 : 0;
47
- },
34
+ button: null,
35
buttons: null,
36
relatedTarget: function(event) {
37
return event.relatedTarget ||