Hide cursor while dragging number inputs in Safari to approximate PointerLock, and disable it on desktop (#3425)

* Make pointerlock conditional and opt out on Safari and desktop

* Add Safari workaround
This commit is contained in:
Keavon Chambers
2025-11-27 00:12:58 -08:00
committed by GitHub
parent 8383a3afac
commit ab5c87f017
4 changed files with 134 additions and 82 deletions
@@ -1,3 +1,5 @@
import { isPlatformNative } from "@graphite/../wasm/pkg/graphite_wasm.js";
export function browserVersion(): string {
const agent = window.navigator.userAgent;
let match = agent.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
@@ -37,6 +39,10 @@ export function operatingSystem(): OperatingSystem {
return osTable[userAgentOS || "Unknown"];
}
export function isDesktop(): boolean {
return isPlatformNative();
}
export function isEventSupported(eventName: string) {
const onEventName = `on${eventName}`;