From 5de6b6491b745effeab48f687dda1ae8bcbc348e Mon Sep 17 00:00:00 2001 From: gimmyhehe <975402925@qq.com> Date: Wed, 2 Jul 2025 11:47:59 +0800 Subject: [PATCH] fix(grid): fix cell click event error on edit mode (#3549) --- packages/vue/src/grid/src/composable/useCellEvent.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/vue/src/grid/src/composable/useCellEvent.ts b/packages/vue/src/grid/src/composable/useCellEvent.ts index 683c6b97a..0c3a71f5f 100644 --- a/packages/vue/src/grid/src/composable/useCellEvent.ts +++ b/packages/vue/src/grid/src/composable/useCellEvent.ts @@ -1,6 +1,6 @@ /* eslint-disable no-cond-assign */ import { hooks } from '@opentiny/vue-common' -import { off, on, isNull } from '@opentiny/utils' +import { off, on, isNull, fastdom } from '@opentiny/utils' import { isUndefined } from '@opentiny/vue-renderless/grid/static/' import { updateCellTitle, emitEvent } from '@opentiny/vue-renderless/grid/utils' @@ -220,7 +220,10 @@ export const useCellEvent = ({ table, $table }) => { satisfy(({ type }) => type === 'selection', selectConfig.trigger) || satisfy(({ treeNode }) => treeNode, treeConfig.trigger)) ) { - $table.triggerCellClickEvent(e, params) + // 捕获阶段单元格进入编辑态,常显态的点击事件会被vue移除从而不会执行 + fastdom.mutate(() => { + $table.triggerCellClickEvent(e, params) + }) } if (source.part === 'footer' && tableListeners['footer-cell-click']) {