CursorLayer: a queued hover update can override lockCursor()

未关闭 适合新手
#457 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
frontend

调研方向

阅读 src/components/canvas/layers/cursorLayer/CursorLayer.ts 中 mouseenter 和 lockCursor() 逻辑附近的代码;与链接的 v2 文件 packages/graph/src/components/canvas/layers/cursorLayer/CursorLayer.ts 进行比较。复现锁定后排队的 hover 更新,然后验证光标会一直保持锁定状态,直到调用 unlockCursor(),并且解锁时会应用当前目标对应的光标。

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

描述

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.

主要语言
TypeScript
星标
145
派生
12
平均合并
1 天 14 小时
30 天内合并 PR
43

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

gravity-ui/graph 的其他 Issue

查看 gravity-ui/graph 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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