diff --git a/common/changes/@visactor/vgrammar-core/fix-element-highlight-reset_2025-05-15-06-11.json b/common/changes/@visactor/vgrammar-core/fix-element-highlight-reset_2025-05-15-06-11.json new file mode 100644 index 000000000..fa4e2db2d --- /dev/null +++ b/common/changes/@visactor/vgrammar-core/fix-element-highlight-reset_2025-05-15-06-11.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: highlight elements should be reset when mouse enter tooltip\n\n", + "type": "none", + "packageName": "@visactor/vgrammar-core" + } + ], + "packageName": "@visactor/vgrammar-core", + "email": "dingling112@gmail.com" +} \ No newline at end of file diff --git a/packages/vgrammar-core/src/interactions/element-highlight.ts b/packages/vgrammar-core/src/interactions/element-highlight.ts index e921a63a7..542d5460f 100644 --- a/packages/vgrammar-core/src/interactions/element-highlight.ts +++ b/packages/vgrammar-core/src/interactions/element-highlight.ts @@ -117,6 +117,7 @@ export class ElementHighlight extends BaseInteraction { if (!this._statedElements || !this._statedElements.length) { return; } + const element = e.element; if (element) { @@ -127,6 +128,8 @@ export class ElementHighlight extends BaseInteraction { } else if (this._resetType === 'self' && hasActiveElement) { this.resetAll(); } + } else if (this._resetType === 'view') { + this.resetAll(); } }; }