File tree Expand file tree Collapse file tree
frontend/src/components/widgets/inputs Expand file tree Collapse file tree Original file line number Diff line number Diff line change 315315 // Don't drag the text value from is input element
316316 e .preventDefault ();
317317
318- // Get the event target and set the requestPointerLock immediately
319- // Safari seems to require requestPointerLock() to be called directly inside the pointerdown handler instead of later in beginDrag().
320- const target = e .target || undefined ;
321- if (! (target instanceof HTMLElement )) return ;
322-
323- target .requestPointerLock ();
324-
325318 // Now we need to wait and see if the user follows this up with a mousemove or mouseup.
326319
327320 // For some reason, both events can get fired before their event listeners are removed, so we need to guard against both running.
332325 if (alreadyActedGuard ) return ;
333326 alreadyActedGuard = true ;
334327 isDragging = true ;
328+
329+ // We need to request pointer lock as immediately as possible for Safari compatibility
330+ const target = e .target || undefined ;
331+ if (! (target instanceof HTMLElement )) return ;
332+
333+ target .requestPointerLock ();
334+
335335 beginDrag ();
336336 removeEventListener (" pointermove" , onMove );
337337 };
You can’t perform that action at this time.
0 commit comments