GraphiteEditor / GraphiteEditor/Graphite

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

未关闭
#2,807 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Good First Issue Help Wanted Paper Cut Web
主要语言
Rust
星标
27.2k
派生
1.3k
平均合并
20 小时 5 分钟
30 天内合并 PR
57

描述

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

贡献指南

这个仓库没有索引到贡献指南

调研方向

从 NumberInput.svelte 开始,通过在 Properties 面板的笔画粗细字段上快速、短距离地向左和向右拖动,复现 increment-mode 的行为。在比较 Chrome 和 Firefox 的同时,记录 pointer-lock 值、鼠标位置和当前状态。拖动开始时该值不再出现意外的大幅跳变,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
frontend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。