Skip to content

Commit edc8ca7

Browse files
committed
fix: wrong select target
1 parent bc94975 commit edc8ca7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/customLink.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const createText = function (string: string, x: number, y: number, color?: strin
3434
y: y + '',
3535
fill: color || '#666',
3636
})
37+
text.dataset.type = 'custom-link'
3738
text.innerHTML = string
3839
return text
3940
}

src/mouse.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ export default function (mind: MindElixirInstance) {
2525
} else if (isTopic(target)) {
2626
mind.selectNode(target as Topic, false, e)
2727
} else if (target.tagName === 'text') {
28-
mind.selectSummary(target.parentElement as unknown as SummarySvgGroup)
29-
} else if (target.tagName === 'path') {
30-
if (target?.parentElement?.tagName === 'g') {
28+
if (target.dataset.type === 'custom-link') {
3129
mind.selectLink(target.parentElement as CustomSvg)
30+
} else {
31+
mind.selectSummary(target.parentElement as unknown as SummarySvgGroup)
3232
}
3333
} else if (target.className === 'circle') {
3434
// skip circle

0 commit comments

Comments
 (0)