Skip to content

Commit 3a6869f

Browse files
authored
Merge pull request #655 from VisActor/fix/element-highlight-reset
Fix/element highlight reset
2 parents 75ed421 + 5025591 commit 3a6869f

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "fix: highlight elements should be reset when mouse enter tooltip\n\n",
5+
"type": "none",
6+
"packageName": "@visactor/vgrammar-core"
7+
}
8+
],
9+
"packageName": "@visactor/vgrammar-core",
10+
"email": "dingling112@gmail.com"
11+
}

packages/vgrammar-core/src/interactions/element-highlight.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ export class ElementHighlight extends BaseInteraction<ElementHighlightOptions> {
117117
if (!this._statedElements || !this._statedElements.length) {
118118
return;
119119
}
120+
120121
const element = e.element;
121122

122123
if (element) {
@@ -127,6 +128,8 @@ export class ElementHighlight extends BaseInteraction<ElementHighlightOptions> {
127128
} else if (this._resetType === 'self' && hasActiveElement) {
128129
this.resetAll();
129130
}
131+
} else if (this._resetType === 'view') {
132+
this.resetAll();
130133
}
131134
};
132135
}

0 commit comments

Comments
 (0)