You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can start a PR if you accept this solution. I'ill add the missing references if you find any.
Reproduction link / 复现链接
No response
Steps to Reproduce the Bug or Issue / 重现步骤
new G6.Graph({
// other options...
behaviors: [
/** @type {import("@antv/g6").ClickSelectOptions} */
({
type: "click-select",
onClick: ({ target }) => {
if ("getPorts" in target) { // Narrow target down from (Document | Element) to (Node | Combo)
// TypeScript Error: target (Node | Combo) has no "drawKeyShape" method
console.log(target.drawKeyShape);
// Actually can log the method without type error
}
},
}),
],
});
Version / 版本
🆕 5.x
OS / 操作系统
macOS
Windows
Linux
Others / 其他
Browser / 浏览器
Chrome
Edge
Firefox
Safari (Limited support / 有限支持)
IE (Nonsupport / 不支持)
Others / 其他
The text was updated successfully, but these errors were encountered:
Describe the bug / 问题描述
For example, methods in
BaseNode
like:drawKeyShape()
,getIconStyle()
, andgetKeyStyle()
don't exist on interfaceNode
.In this branch, I added:
Then I replaced references to
Element
withTargetElement
.https://github.com/Crystal-RainSlide/G6/tree/refactor-TargetElement
I can start a PR if you accept this solution. I'ill add the missing references if you find any.
Reproduction link / 复现链接
No response
Steps to Reproduce the Bug or Issue / 重现步骤
Version / 版本
🆕 5.x
OS / 操作系统
Browser / 浏览器
The text was updated successfully, but these errors were encountered: