diff --git a/src/event/createEvent.ts b/src/event/createEvent.ts index dc38aaa6..ae2647fa 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, @@ -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),