antvis/G6

cursor 状态不会自动变化 #6056

CoolRice posted onGitHub

Describe the bug / 问题描述

版本: 4.8.10 给外层的shape添加了cursor pointer,鼠标移出后pointer不会自动变回来

但是只给里面shape加cursor,是正常的

https://stackblitz.com/edit/react-ts8fzq?file=package.json,index.js

Steps to Reproduce the Bug or Issue / 重现步骤

No response

G6 Version / G6 版本

4.x

Operating System / 操作系统

Windows

Browser / 浏览器

Chrome

Additional context / 补充说明

No response


由于 shape 的 cursor 属性默认设置为 default,因此当鼠标从小圆点移至主图形时,光标会从 pointer 变为 default,这一行为是符合预期的。

如果希望在鼠标离开自定义节点时光标能够恢复到默认样式,我们建议您手动监听 node:pointerleave 事件来实现这一功能。当该事件触发时,可以通过执行 graph.get('canvas').setCursor('default'); 来设置光标样式。

我们现在将关闭此 issue。如果您后续还有任何疑问或需要进一步的帮助,请随时重新打开它~

posted by yvonneyx 9 months ago

Fund this Issue

$0.00
Funded

Pull requests