mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-27 00:08:12 +08:00
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:
@@ -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}`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user