CursorLayer: a queued hover update can override lockCursor()

Đang mở Phù hợp với người mới
#457 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
82/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Đọc phần xung quanh logic mouseenter và lockCursor() trong src/components/canvas/layers/cursorLayer/CursorLayer.ts; so sánh với tệp v2 được liên kết tại packages/graph/src/components/canvas/layers/cursorLayer/CursorLayer.ts. Tái hiện cập nhật hover được đưa vào hàng đợi sau khi khóa, rồi xác minh rằng con trỏ vẫn bị khóa cho đến khi gọi unlockCursor() và việc mở khóa áp dụng con trỏ cho mục tiêu hiện tại.

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

Mô tả

Reproduction

  1. With the cursor layer in automatic mode, move the pointer onto an interactive canvas component whose cursor is pointer.
  2. Before the scheduled hover update runs, call graph.lockCursor("wait"). Calling it in the next animation frame after mouseenter is one way to exercise this ordering.
  3. Leave the pointer still and let the scheduler advance.

The root cursor is initially wait. The pending hover callback then sets it to pointer while the cursor layer is still in manual mode.

Expected behavior

The locked cursor should remain in effect until unlockCursor() or another lockCursor() call. Unlocking should still apply the cursor for the current target.

mouseenter checks the mode before queueing its update, but the callback does not check it when it runs. lockCursor() leaves the queued callback in place. This applies to main and v2.

Ngôn ngữ chính
TypeScript
Star
145
Fork
12
Merge trung bình
1 ngày 14 giờ
Pull request đã merge (30 ngày)
43

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của gravity-ui/graph

Tất cả issue của gravity-ui/graph

Issue tương tự

Thêm issue về TypeScript

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.