From cd66b1af9e415569c12e39835c5fc1ff24b37dbc Mon Sep 17 00:00:00 2001 From: fangsmile <892739385@qq.com> Date: Mon, 17 Jun 2024 10:49:23 +0800 Subject: [PATCH] fix: getCellAtRelativePosition occor error --- packages/vtable/src/core/utils/get-cell-position.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/vtable/src/core/utils/get-cell-position.ts b/packages/vtable/src/core/utils/get-cell-position.ts index b7565c47d..1fc757910 100644 --- a/packages/vtable/src/core/utils/get-cell-position.ts +++ b/packages/vtable/src/core/utils/get-cell-position.ts @@ -367,7 +367,9 @@ export function getCellAtRelativePosition(x: number, y: number, _this: BaseTable const colInfo = getTargetColAtConsiderRightFrozen(rightFrozen ? x : x + _this.scrollLeft, rightFrozen, _this); const rowInfo = getTargetRowAtConsiderBottomFrozen(bottomFrozen ? y : y + _this.scrollTop, bottomFrozen, _this); - + if (!colInfo || !rowInfo) { + return undefined; + } const { row, top, bottom, height } = rowInfo; const { col, left, right, width } = colInfo; const rect = {