mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +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;
|
||||
|
||||
document.exitPointerLock();
|
||||
|
||||
// Fallback for Safari in case pointerlockchange never fires
|
||||
setTimeout(() => {
|
||||
if (!document.pointerLockElement) pointerLockChange();
|
||||
}, 0);
|
||||
};
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user