Reproduction link
Steps to reproduce
Tree组件添加虚拟滚动后,再开启拖拽,拖拽到盒子底部滚动条无法向下滚动
What is expected?
\修复
What is actually happening?
Tree组件添加虚拟滚动后,再开启拖拽,拖拽到盒子底部滚动条无法向下滚动
| Environment | Info |
| ------------ | ------------ |
| antd | 5.15.0 |
| React | 18 |
| System | mac |
| Browser | 122.0.6261.94(正式版本) (x86_64) |
3条答案
按热度按时间pb3s4cty1#
I'm facing the same problem with virtualized drag and drop table
ylamdve62#
复现的 codesandbox 公开一下
mfuanj7w3#
复现的 codesandbox 公开一下
import { createRoot } from "react-dom/client";
import React, { useState } from "react";
import { Tree } from "antd";
import "antd/dist/reset.css";
const dig = (path = "0", level = 3) => {
const list = [];
for (let i = 0; i < 10; i += 1) {
const key =
${path}-${i}
;const treeNode = {
title: key,
key,
};
if (level > 0) {
treeNode.children = dig(key, level - 1);
}
list.push(treeNode);
}
return list;
};
const treeData = dig();
const App = () => {
const [gData, setGData] = useState(treeData);
const [expandedKeys] = useState(["0-0", "0-0-0", "0-0-0-0"]);
const onDragEnter = (info) => {
console.log(info);
// expandedKeys, set it when controlled is needed
// setExpandedKeys(info.expandedKeys)
};
const onDrop = (info) => {
console.log(info);
const dropKey = info.node.key;
const dragKey = info.dragNode.key;
const dropPos = info.node.pos.split("-");
const dropPosition =
info.dropPosition - Number(dropPos[dropPos.length - 1]); // the
};
return (
);
};
const root = createRoot(document.getElementById("root"));
root.render();