GraphiteEditor / GraphiteEditor/Graphite

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

Đang mở
#2,807 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
Good First Issue Help Wanted Paper Cut Web
Ngôn ngữ chính
Rust
Star
27.2k
Fork
1.3k
Merge trung bình
20 giờ 5 phút
Pull request đã merge (30 ngày)
57

Mô tả

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Bắt đầu với NumberInput.svelte và tái hiện hành vi của increment-mode bằng cách kéo nhanh, ngắn sang trái và phải trên trường độ dày nét trong bảng Properties. Ghi lại các giá trị pointer-lock, vị trí chuột và trạng thái hiện tại trong khi so sánh Chrome với Firefox. Hoàn thành khi giá trị không còn nhảy một khoảng lớn ngoài dự kiến lúc bắt đầu kéo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript
Lĩnh vực
frontend
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
48/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.