From 14638b120c30e7ccb08078e85b3cc90b4d9e7edb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=9D=A8=E6=9E=9A?= Date: Thu, 8 May 2025 14:44:45 +0800 Subject: [PATCH 1/3] fix: unintended edit state activation on functional button clicks --- packages/vtable/src/edit/edit-manager.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/vtable/src/edit/edit-manager.ts b/packages/vtable/src/edit/edit-manager.ts index ef4ebe7ebe..c8993f1393 100644 --- a/packages/vtable/src/edit/edit-manager.ts +++ b/packages/vtable/src/edit/edit-manager.ts @@ -6,6 +6,7 @@ import { getCellEventArgsSet } from '../event/util'; import type { SimpleHeaderLayoutMap } from '../layout'; import { isPromise } from '../tools/helper'; import { isValid } from '@visactor/vutils'; +import type { IIconGraphicAttribute } from '../scenegraph/graphic/icon'; export class EditManager { table: BaseTableAPI; @@ -43,6 +44,10 @@ export class EditManager { // 如果是双击自动列宽 则编辑不开启 return; } + if ((e.target?.attribute as IIconGraphicAttribute)?.funcType) { + // 点击功能图标不进入编辑 + return; + } this.beginTriggerEditCellMode = 'doubleclick'; this.startEditCell(col, row); }); @@ -50,6 +55,10 @@ export class EditManager { const clickEventId = table.on(TABLE_EVENT_TYPE.CLICK_CELL, e => { const { editCellTrigger = 'doubleclick' } = table.options; if (editCellTrigger === 'click' || (Array.isArray(editCellTrigger) && editCellTrigger.includes('click'))) { + if ((e.target?.attribute as IIconGraphicAttribute)?.funcType) { + // 点击功能图标不进入编辑 + return; + } this.beginTriggerEditCellMode = 'click'; const { col, row } = e; this.startEditCell(col, row); From 34bab04785a921a4c03408e1763f2dc62e086d79 Mon Sep 17 00:00:00 2001 From: fangsmile <892739385@qq.com> Date: Thu, 8 May 2025 19:38:56 +0800 Subject: [PATCH 2/3] docs: update changlog of rush --- ...ix-click-edit-state-handling_2025-05-08-11-38.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 common/changes/@visactor/vtable/fix-click-edit-state-handling_2025-05-08-11-38.json diff --git a/common/changes/@visactor/vtable/fix-click-edit-state-handling_2025-05-08-11-38.json b/common/changes/@visactor/vtable/fix-click-edit-state-handling_2025-05-08-11-38.json new file mode 100644 index 0000000000..ccb3cf8863 --- /dev/null +++ b/common/changes/@visactor/vtable/fix-click-edit-state-handling_2025-05-08-11-38.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "Merge pull request #3843 from 7dingdang0/fix/click-edit-state-handling\n\nfix: unintended edit state activation on functional button clicks\n", + "type": "none", + "packageName": "@visactor/vtable" + } + ], + "packageName": "@visactor/vtable", + "email": "892739385@qq.com" +} \ No newline at end of file From bf5b80c0a327e1a95f5175fa102f9ee63227065f Mon Sep 17 00:00:00 2001 From: fangsmile <892739385@qq.com> Date: Thu, 8 May 2025 19:40:09 +0800 Subject: [PATCH 3/3] chore: update changelog --- .../vtable/fix-click-edit-state-handling_2025-05-08-11-38.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/changes/@visactor/vtable/fix-click-edit-state-handling_2025-05-08-11-38.json b/common/changes/@visactor/vtable/fix-click-edit-state-handling_2025-05-08-11-38.json index ccb3cf8863..47cd7ddf34 100644 --- a/common/changes/@visactor/vtable/fix-click-edit-state-handling_2025-05-08-11-38.json +++ b/common/changes/@visactor/vtable/fix-click-edit-state-handling_2025-05-08-11-38.json @@ -1,7 +1,7 @@ { "changes": [ { - "comment": "Merge pull request #3843 from 7dingdang0/fix/click-edit-state-handling\n\nfix: unintended edit state activation on functional button clicks\n", + "comment": "fix: unintended edit state activation on functional button clicks\n\n", "type": "none", "packageName": "@visactor/vtable" }