From 6d7e5a6206aa0bd761ecf6666a6ba83f913093de Mon Sep 17 00:00:00 2001 From: Takeru Chuganji Date: Tue, 11 Jun 2024 23:39:59 +0900 Subject: [PATCH 1/2] Fix a typo --- src/event/createEvent.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/event/createEvent.ts b/src/event/createEvent.ts index dc38aaa6..65e6369f 100644 --- a/src/event/createEvent.ts +++ b/src/event/createEvent.ts @@ -26,14 +26,14 @@ const eventInitializer: { ClipboardEvent: [initClipboardEvent], Event: [], InputEvent: [initUIEvent, initInputEvent], - MouseEvent: [initUIEvent, initUIEventModififiers, initMouseEvent], + MouseEvent: [initUIEvent, initUIEventModifiers, initMouseEvent], PointerEvent: [ initUIEvent, - initUIEventModififiers, + initUIEventModifiers, initMouseEvent, initPointerEvent, ], - KeyboardEvent: [initUIEvent, initUIEventModififiers, initKeyboardEvent], + KeyboardEvent: [initUIEvent, initUIEventModifiers, initKeyboardEvent], } export function createEvent( @@ -135,7 +135,7 @@ function initUIEvent(event: UIEvent, {view, detail}: UIEventInit) { }) } -function initUIEventModififiers( +function initUIEventModifiers( event: KeyboardEvent | MouseEvent, { altKey, From ba920852bb72ef895efb42a3beaf1276d0abf6e1 Mon Sep 17 00:00:00 2001 From: Takeru Chuganji Date: Wed, 12 Jun 2024 02:32:19 +0900 Subject: [PATCH 2/2] Use 1 as the default width/height values --- src/event/createEvent.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/event/createEvent.ts b/src/event/createEvent.ts index 65e6369f..ae2647fa 100644 --- a/src/event/createEvent.ts +++ b/src/event/createEvent.ts @@ -243,8 +243,8 @@ function initPointerEvent( ) { assignProps(event, { pointerId: sanitizeNumber(pointerId), - width: sanitizeNumber(width), - height: sanitizeNumber(height), + width: width ?? 1, + height: height ?? 1, pressure: sanitizeNumber(pressure), tangentialPressure: sanitizeNumber(tangentialPressure), tiltX: sanitizeNumber(tiltX),