Skip to content

Commit 87e2a1c

Browse files
authored
fix: Movement jumps on windows (#4296)
## Description Seems like closes #4236 For me bug on windows looks a little bit different like a huge scrubbing jumps. But anyway seems like fixed everything described in corresponding issue. ## Steps for reproduction 1. click button 2. expect xyz ## Code Review - [ ] hi @kof, I need you to do - conceptual review (architecture, feature-correctness) - detailed review (read every line) - test it on preview ## Before requesting a review - [ ] made a self-review - [ ] added inline comments where things may be not obvious (the "why", not "what") ## Before merging - [ ] tested locally and on preview environment (preview dev login: 5de6) - [ ] updated [test cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md) document - [ ] added tests - [ ] if any new env variables are added, added them to `.env` file
1 parent 89bca4d commit 87e2a1c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/design-system/src/components/primitives/numeric-gesture-control.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,8 @@ const requestPointerLock = (
287287
// other browsers show a warning banner, making the use of it in this scenario subpar: in which case we fallback to using non-pointerLock means:
288288
// albeit without an infinite cursor ux.
289289
if (shouldUsePointerLock) {
290-
targetNode.requestPointerLock();
290+
// @ts-expect-error - unadjustedMovement is a chromium only feature, fixes random movementX|Y jumps on windows
291+
targetNode.requestPointerLock({ unadjustedMovement: true });
291292
const cursorNode = (targetNode.ownerDocument.querySelector(
292293
"#numeric-guesture-control-cursor"
293294
) ||

0 commit comments

Comments
 (0)