@m3e/core 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -543,13 +543,15 @@ _PressedController_capture = new WeakMap(), _PressedController_callback = new We
|
|
|
543
543
|
if (e.target !== e.currentTarget)
|
|
544
544
|
return;
|
|
545
545
|
const target = e.currentTarget;
|
|
546
|
-
if (
|
|
546
|
+
if (__classPrivateFieldGet(this, _PressedController_isPressedKey, "f")?.call(this, e.key)) {
|
|
547
547
|
if (e.key === " ") {
|
|
548
548
|
e.preventDefault();
|
|
549
549
|
}
|
|
550
|
-
__classPrivateFieldGet(this, _PressedController_pressedTargets, "f").
|
|
551
|
-
|
|
552
|
-
|
|
550
|
+
if (!__classPrivateFieldGet(this, _PressedController_pressedTargets, "f").has(target)) {
|
|
551
|
+
__classPrivateFieldGet(this, _PressedController_pressedTargets, "f").set(target, performance.now());
|
|
552
|
+
const bounds = target.getBoundingClientRect();
|
|
553
|
+
__classPrivateFieldGet(this, _PressedController_callback, "f").call(this, true, { x: bounds.x + bounds.width / 2, y: bounds.y + bounds.height / 2 }, target);
|
|
554
|
+
}
|
|
553
555
|
}
|
|
554
556
|
}, _PressedController_handleKeyUp = function _PressedController_handleKeyUp(e) {
|
|
555
557
|
const target = e.target;
|