From b5881267a48a37cea0c112963b2fb724a239f123 Mon Sep 17 00:00:00 2001 From: "lixuefei.1313" Date: Wed, 25 Mar 2026 17:00:30 +0800 Subject: [PATCH] fix(vchart): fix an issue where mark states were not properly cleared when updateSpec was called, causing incorrect state persistence --- ...f-mark-state-when-updateSpec_2026-03-25-08-59.json | 11 +++++++++++ packages/vchart/src/mark/base/base-mark.ts | 3 +++ 2 files changed, 14 insertions(+) create mode 100644 common/changes/@visactor/vchart/009-fix-issue-of-mark-state-when-updateSpec_2026-03-25-08-59.json diff --git a/common/changes/@visactor/vchart/009-fix-issue-of-mark-state-when-updateSpec_2026-03-25-08-59.json b/common/changes/@visactor/vchart/009-fix-issue-of-mark-state-when-updateSpec_2026-03-25-08-59.json new file mode 100644 index 0000000000..fb73222957 --- /dev/null +++ b/common/changes/@visactor/vchart/009-fix-issue-of-mark-state-when-updateSpec_2026-03-25-08-59.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "update changes for 009-fix-issue-of-mark-state-when-updateSpec: Fix an issue where mark states were not properly cleared when updateSpec was called, causing incorrect state persistence.", + "type": "none", + "packageName": "@visactor/vchart" + } + ], + "packageName": "@visactor/vchart", + "email": "lixuef1313@163.com" +} \ No newline at end of file diff --git a/packages/vchart/src/mark/base/base-mark.ts b/packages/vchart/src/mark/base/base-mark.ts index 81d292edee..74628db447 100644 --- a/packages/vchart/src/mark/base/base-mark.ts +++ b/packages/vchart/src/mark/base/base-mark.ts @@ -1087,6 +1087,9 @@ export class BaseMark extends GrammarItem implements IMar return; } this._product = mark.getProduct(); + if (!this._product) { + return; + } this._product.clearStates(); this._graphics = mark.getGraphics(); this._graphics.forEach(g => {