react-arborist icon indicating copy to clipboard operation
react-arborist copied to clipboard

Allow user to scroll while dragging a node

Open mariosant opened this issue 2 months ago • 0 comments

I am wondering how to achieve dragging the tree container up or down when the user is dragging a node that's not visible. My container looks like this:

          <Tree
            openByDefault
            height={treeContainer.height ?? 1}
            width={treeContainer.width ?? 1}
            rowHeight={80}
            data={treeNodes as any}
            onMove={handleMove as any}
            renderRow={({ attrs, node, children, innerRef }) => (
              <Box
                ref={innerRef}
                sx={{ pl: `${node.level * 32}px` }}
                {...attrs}
              >
                {children}
              </Box>
            )}
            renderDragPreview={({ isDragging, mouse }) => (
              <Paper
                variant="outlined"
                sx={{...}}
              >
                <DragIndicator />
                <Box
                  sx={{...}}
                />
              </Paper>
            )}
          >
            {TreeNodeComponent}
          </Tree>```

mariosant avatar Nov 24 '25 10:11 mariosant