diff --git a/src/table/PrimaryTable.tsx b/src/table/PrimaryTable.tsx index a96215d62..33d45c303 100644 --- a/src/table/PrimaryTable.tsx +++ b/src/table/PrimaryTable.tsx @@ -196,9 +196,13 @@ const PrimaryTable = forwardRef((props, ref } }; - const onInnerRowClick: TdPrimaryTableProps['onRowClick'] = (context) => { - onInnerExpandRowClick(context); - onInnerSelectRowClick(context); + const onInnerRowClick: TdPrimaryTableProps['onRowClick'] = (params) => { + if (props.expandOnRowClick) { + onInnerExpandRowClick(params); + } + if (props.selectOnRowClick) { + onInnerSelectRowClick(params); + } }; function formatNode(api: string, renderInnerNode: Function, condition: boolean, extra?: { reverse?: boolean }) { diff --git a/src/table/hooks/useColumnResize.tsx b/src/table/hooks/useColumnResize.tsx index 57f5a9498..0df3ddb80 100644 --- a/src/table/hooks/useColumnResize.tsx +++ b/src/table/hooks/useColumnResize.tsx @@ -110,7 +110,7 @@ export default function useColumnResize(params: { // 只在表头显示拖拽图标 const onColumnMouseover = (e: MouseEvent, col: BaseTableCol) => { // calculate mouse cursor before drag start - if (!resizeLineRef.current || resizeLineParams.isDragging) return; + if (!resizeLineRef.current || resizeLineParams.isDragging || !e.target) return; const target = (e.target as HTMLElement).closest('th'); if (!target) return; // 判断是否为叶子阶段,仅叶子结点允许拖拽