-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Defines whether content can be dropped inside an item. Children are still allowed, it's just impossible to drop any more children inside.
import React, { useState } from "react";
import { ReactTreeList, ReactTreeListProps } from '@bartaxyz/react-tree-list';
const Component: React.FC = () => {
const [data, setData] = useState<ReactTreeListProps["data"]>([
{
label: "none",
// This parameter will keep current children but prevent other items to be dropped inside
allowDropInside: true,
// Nodes inside "children" will be displayed and it will be possible to sort them, or drag them out
children: [
{ label: "Heyo", },
],
},
]);
return (
<ReactTreeList
data={data}
onChange={setData}
/>
);
};Default: true
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request