Skip to content

Commit a52cf40

Browse files
committed
Add canDrop example to demo site
1 parent 0e5cdb1 commit a52cf40

File tree

1 file changed

+6
-0
lines changed
  • src/examples/basicExample

1 file changed

+6
-0
lines changed

src/examples/basicExample/app.js

+6
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ class App extends Component {
124124
},
125125
],
126126
},
127+
{
128+
title: 'You cannot give this children',
129+
subtitle: 'Dropping is prevented via the `canDrop` API using `nextParent`',
130+
noChildren: true,
131+
},
127132
{
128133
title: 'When node contents are really long, it will cause a horizontal scrollbar' +
129134
' to appear. Deeply nested elements will also trigger the scrollbar.',
@@ -282,6 +287,7 @@ class App extends Component {
282287
maxDepth={maxDepth}
283288
searchQuery={searchString}
284289
searchFocusOffset={searchFocusIndex}
290+
canDrop={({ nextParent }) => !nextParent || !nextParent.noChildren}
285291
searchFinishCallback={matches =>
286292
this.setState({
287293
searchFoundCount: matches.length,

0 commit comments

Comments
 (0)