From 533a7842d191733a8b2d541c34f91445dcf8661f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Wiedemann?= Date: Sun, 2 Apr 2023 18:46:27 +0000 Subject: [PATCH] fix: extra space at bottom because of the card's action-handler --- src/action-handler-directive.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/action-handler-directive.ts b/src/action-handler-directive.ts index 48ce878..57b8440 100644 --- a/src/action-handler-directive.ts +++ b/src/action-handler-directive.ts @@ -49,7 +49,7 @@ class ActionHandler extends HTMLElement implements ActionHandler { public connectedCallback() { Object.assign(this.style, { - position: 'absolute', + position: 'fixed', width: isTouch ? '100px' : '50px', height: isTouch ? '100px' : '50px', transform: 'translate(-50%, -50%)', @@ -116,11 +116,11 @@ class ActionHandler extends HTMLElement implements ActionHandler { let x; let y; if ((ev as TouchEvent).touches) { - x = (ev as TouchEvent).touches[0].pageX; - y = (ev as TouchEvent).touches[0].pageY; + x = (ev as TouchEvent).touches[0].clientX; + y = (ev as TouchEvent).touches[0].clientY; } else { - x = (ev as MouseEvent).pageX; - y = (ev as MouseEvent).pageY; + x = (ev as MouseEvent).clientX; + y = (ev as MouseEvent).clientY; } if (options.hasHold) {