From 13232f326b4636bbac0b4ab361fbe432bd9a61f2 Mon Sep 17 00:00:00 2001 From: sunhao Date: Sat, 6 Jul 2024 13:35:54 +0800 Subject: [PATCH] * dtable: hide contextmenu on start resizing col. --- lib/dtable/src/plugins/resize/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/dtable/src/plugins/resize/index.tsx b/lib/dtable/src/plugins/resize/index.tsx index 7e1838aa45..90994d4bc1 100644 --- a/lib/dtable/src/plugins/resize/index.tsx +++ b/lib/dtable/src/plugins/resize/index.tsx @@ -1,3 +1,4 @@ +import {$} from '@zui/core'; import {clamp} from '../../helpers/number'; import {definePlugin} from '../../helpers/shared-plugins'; import {mousemove} from '../mousemove'; @@ -84,7 +85,8 @@ const resizePlugin: DTablePlugin = { if (!splitter) { return; } - const colName = splitter.closest('.dtable-cell')?.dataset.col; + const cellElement = splitter.closest('.dtable-cell'); + const colName = cellElement?.dataset.col; if (!colName) { return; } @@ -94,7 +96,10 @@ const resizePlugin: DTablePlugin = { startSize: this.state.colsSizes[colName] ?? 0, startX: event.clientX, }, + }, () => { + $(cellElement!).zuiCall('ContextMenu.hide'); }); + return false; }, dblclick(event) {