GraphiteEditor / GraphiteEditor/Graphite

JS debugging: dragging the increment mode number field sometimes jumps at the start

Abierto
#2,807 3 comentarios 0 reacciones 0 asignados Ver en GitHub
Good First Issue Help Wanted Paper Cut Web
Lenguaje dominante
Rust
Estrellas
27.2k
Forks
1.3k
Merge medio
20 h 5 min
PR fusionados (30 d)
57

Descripción

This seems to probably happen more commonly in Chrome, and it seems to be harder to reproduce in Firefox (I wasn't able to reproduce it in FF in my testing right now, @0HyperCube mentions in the comments below that he has encountered it in FF). See `NumberInput.svelte`.

When you click and drag a number input field of the increment (not range) style, meaning the kind you can drag infinitely left or right, it will sometimes teleport the value to a wildly different value from the one it started with. This can be reproduced by drawing a rectangle and dragging left and right on its stroke weight parameter in the Properties panel repeatedly in quick, small left and right drags until occasionally it will make a big jump.

I hypothesize this is caused by weirdness in the event ordering and mouse position reporting with the [pointer lock](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API) API, and it might be related to the widget being broken in Safari: #2038. I recommend logging the values that are being reported by the API and current state every frame to narrow down when the events occur and produce the discrepancy.

At the 4-second mark in this video, we see it jump from `131.3` to `17.3` immediately when the click-and-drag begins:

https://github.com/user-attachments/assets/61b1b1e6-4560-4555-aac5-f7b54cbfacb9

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.