We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ca22399 commit 3c683a7Copy full SHA for 3c683a7
packages/components/table/hooks/useDragSort.ts
@@ -64,7 +64,11 @@ export default function useDragSort(
64
65
// 行拖拽排序
66
const registerRowDragEvent = (element: HTMLDivElement): void => {
67
- if (!isRowHandlerDraggable.value && !isRowDraggable.value) return;
+ /**
68
+ * fix: https://github.com/Tencent/tdesign-vue-next/issues/4985
69
+ * 若table内容未渲染(即element子元素为空),拖拽事件不注册
70
+ */
71
+ if (element?.children?.length === 0 && !isRowHandlerDraggable.value && !isRowDraggable.value) return;
72
const dragContainer = element?.querySelector('tbody');
73
if (!dragContainer) {
74
console.error('tbody does not exist.');
0 commit comments