From a8e1ef1780b23707bf7bc22619b43d8b2fd17035 Mon Sep 17 00:00:00 2001 From: Yomotsu Date: Wed, 14 Feb 2024 16:44:54 +0900 Subject: [PATCH] fix: worker example --- examples/worker.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/examples/worker.js b/examples/worker.js index 7fcc520..e83af1f 100644 --- a/examples/worker.js +++ b/examples/worker.js @@ -65,12 +65,19 @@ self.onmessage = ( { data } ) => { } - case 'pointerdown': + case 'pointerdown': { + + const { event } = payload; + pseudoElement.dispatchEvent( { type: action, ...event } ); + break; + + } + case 'pointermove': case 'pointerup': { const { event } = payload; - pseudoElement.dispatchEvent( { type: action, ...event } ); + pseudoElement.ownerDocument.dispatchEvent( { type: action, ...event } ); break; }