mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01: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:
parent
3829859e22
commit
d99b3fc6d6
|
|
@ -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 ||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user