Files
react/packages/react-dom/src/events/SyntheticMouseEvent.js
T
2017-12-12 16:45:40 +00:00

40 lines
906 B
JavaScript

/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import SyntheticUIEvent from './SyntheticUIEvent';
import getEventModifierState from './getEventModifierState';
/**
* @interface MouseEvent
* @see http://www.w3.org/TR/DOM-Level-3-Events/
*/
const SyntheticMouseEvent = SyntheticUIEvent.extend({
screenX: null,
screenY: null,
clientX: null,
clientY: null,
pageX: null,
pageY: null,
ctrlKey: null,
shiftKey: null,
altKey: null,
metaKey: null,
getModifierState: getEventModifierState,
button: null,
buttons: null,
relatedTarget: function(event) {
return (
event.relatedTarget ||
(event.fromElement === event.srcElement
? event.toElement
: event.fromElement)
);
},
});
export default SyntheticMouseEvent;