@@ -33,7 +33,8 @@ type Props = {
33
33
const nodeList = [ ] ;
34
34
35
35
const collectNodes = ( node ) => {
36
- nodeList . splice ( 0 , nodeList . length ) ;
36
+ console . log ( "This is the root node" , node ) ;
37
+ nodeList . splice ( 0 , nodeList . length ) ; { /* We used the .splice method here to ensure that nodeList did not accumulate with page refreshes */ }
37
38
nodeList . push ( node ) ;
38
39
for ( let i = 0 ; i < nodeList . length ; i ++ ) {
39
40
const cur = nodeList [ i ] ;
@@ -44,7 +45,6 @@ const collectNodes = (node) => {
44
45
}
45
46
}
46
47
console . log ( 'NODELIST looks like: ' , nodeList ) ;
47
-
48
48
}
49
49
50
50
export default function LinkControls ( {
@@ -72,7 +72,7 @@ export default function LinkControls({
72
72
< select
73
73
onClick = { e => e . stopPropagation ( ) }
74
74
onChange = { e => setLayout ( e . target . value ) }
75
- value = { layout }
75
+ // value={layout}
76
76
style = { dropDownStyle }
77
77
>
78
78
< option value = "cartesian" > Cartesian</ option >
@@ -86,7 +86,7 @@ export default function LinkControls({
86
86
< select
87
87
onClick = { e => e . stopPropagation ( ) }
88
88
onChange = { e => setOrientation ( e . target . value ) }
89
- value = { orientation }
89
+ // value={orientation}/
90
90
disabled = { layout === 'polar' }
91
91
style = { dropDownStyle }
92
92
>
@@ -101,7 +101,7 @@ export default function LinkControls({
101
101
< select
102
102
onClick = { e => e . stopPropagation ( ) }
103
103
onChange = { e => setLinkType ( e . target . value ) }
104
- value = { linkType }
104
+ // value={linkType}
105
105
style = { dropDownStyle }
106
106
>
107
107
< option value = "diagonal" > Diagonal</ option >
@@ -111,23 +111,17 @@ export default function LinkControls({
111
111
112
112
{ /* Controls for the select selections. */ }
113
113
< label > Select:</ label >
114
-
115
- < select
116
- onClick = { e => e . stopPropagation ( ) }
114
+ { /*This is a non-breaking space - Prevents an automatic line break at this position */ }
115
+ < input list = 'nodeOptions' type = 'text' name = "nodeOptions"
117
116
onChange = { e => {
118
- const val = e . target . value ;
119
- console . log ( "You selected: " , val ) ;
120
117
setSelectedNode ( e . target . value )
121
118
} }
122
- value = { selectedNode }
123
- style = { dropDownStyle }
124
- >
125
- { console . log ( "snapShots: " , snapShots ) }
126
-
119
+ />
120
+ < datalist id = 'nodeOptions' >
127
121
{ nodeList . map ( node => (
128
122
< option value = { node . name } > { node . name } </ option >
129
123
) ) }
130
- </ select >
124
+ </ datalist >
131
125
132
126
{ /* This is the slider control for the step option */ }
133
127
{ linkType === 'step' && layout !== 'polar' && (
0 commit comments