From d9b8e07b0065db8371e849dcc5137aeb36a97e5a Mon Sep 17 00:00:00 2001 From: Luna Wei Date: Tue, 5 Jul 2022 13:03:11 -0700 Subject: [PATCH] Add offsetX, offsetY to MouseEvent Summary: Changelog: [Internal] - Adding offsetX, offsetY to MouseEvent interface. It's currently provided in a draft form: https://drafts.csswg.org/cssom-view/#extensions-to-the-mouseevent-interface Reviewed By: vincentriemer Differential Revision: D37436051 fbshipit-source-id: b3bb85acb82db348d3e1085881232e5358674ed7 --- Libraries/Types/CoreEventTypes.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Libraries/Types/CoreEventTypes.js b/Libraries/Types/CoreEventTypes.js index a62ddb058b0bfc..8664bce98ed242 100644 --- a/Libraries/Types/CoreEventTypes.js +++ b/Libraries/Types/CoreEventTypes.js @@ -157,6 +157,15 @@ export interface NativeMouseEvent extends NativeUIEvent { * The secondary target for the event, if there is one. */ +relatedTarget: null | number | React.ElementRef>; + // offset is proposed: https://drafts.csswg.org/cssom-view/#extensions-to-the-mouseevent-interface + /** + * The X coordinate of the mouse pointer between that event and the padding edge of the target node + */ + +offsetX: number; + /** + * The Y coordinate of the mouse pointer between that event and the padding edge of the target node + */ + +offsetY: number; } /**