File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
src/examples/basicExample Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ import '../shared/favicon/favicon-32x32.png';
88import '../shared/favicon/favicon.ico' ;
99import '../shared/favicon/safari-pinned-tab.svg' ;
1010
11+ const maxDepth = 5 ;
12+
1113class App extends Component {
1214 constructor ( props ) {
1315 super ( props ) ;
@@ -99,7 +101,7 @@ class App extends Component {
99101 {
100102 expanded : true ,
101103 title : 'Limit nesting with `maxDepth`' ,
102- subtitle : 'It\ 's set to 5 for this example' ,
104+ subtitle : `It 's set to ${ maxDepth } for this example` ,
103105 children : [
104106 {
105107 expanded : true ,
@@ -111,7 +113,10 @@ class App extends Component {
111113 children : [
112114 { title : renderDepthTitle } ,
113115 {
114- title : 'This cannot be dragged deeper' ,
116+ title : ( { path } ) => ( path . length >= maxDepth ?
117+ 'This cannot be dragged deeper' :
118+ 'This can be dragged deeper'
119+ ) ,
115120 } ,
116121 ] ,
117122 } ,
@@ -264,7 +269,7 @@ class App extends Component {
264269 < SortableTree
265270 treeData = { treeData }
266271 onChange = { this . updateTreeData }
267- maxDepth = { 5 }
272+ maxDepth = { maxDepth }
268273 searchQuery = { searchString }
269274 searchFocusOffset = { searchFocusIndex }
270275 searchFinishCallback = { matches =>
You can’t perform that action at this time.
0 commit comments