mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-30 23:48:11 +08:00
Add workaround for a Safari bug where our number input fields can't be released from click-and-drag (#3053)
Added fallback for Safari to trigger a pointerLockChange in case it doesnt fire automatically Co-authored-by: seabeeberry <seri@Mac.fritz.box>
This commit is contained in:
@@ -365,6 +365,11 @@
|
|||||||
cumulativeDragDelta = 0;
|
cumulativeDragDelta = 0;
|
||||||
|
|
||||||
document.exitPointerLock();
|
document.exitPointerLock();
|
||||||
|
|
||||||
|
// Fallback for Safari in case pointerlockchange never fires
|
||||||
|
setTimeout(() => {
|
||||||
|
if (!document.pointerLockElement) pointerLockChange();
|
||||||
|
}, 0);
|
||||||
};
|
};
|
||||||
const pointerMove = (e: PointerEvent) => {
|
const pointerMove = (e: PointerEvent) => {
|
||||||
// Abort the drag if right click is down. This works here because a "pointermove" event is fired when right clicking even if the cursor didn't move.
|
// Abort the drag if right click is down. This works here because a "pointermove" event is fired when right clicking even if the cursor didn't move.
|
||||||
|
|||||||
Reference in New Issue
Block a user