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:
Ciftci 2025-08-19 07:30:18 +02:00 committed by GitHub
parent 615c035683
commit 36a1453d03
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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.