@@ -23,7 +23,6 @@ export class InsertNodeModal {
2323 { label : 'String' , selected : true } ,
2424 { label : 'Number' , selected : false } ,
2525 ] ;
26- @State ( ) propSelectedOptionLabel : string = 'String' ;
2726 @State ( ) isFormValid : boolean = true ;
2827
2928 componentWillLoad ( ) {
@@ -47,7 +46,7 @@ export class InsertNodeModal {
4746 discardAddNode ( ) {
4847 this . isFormValid = true ;
4948 this . toggleModalState ( ) ;
50- this . addNodeState = [ { property : '' , value : '' , valueType : '' } ] ;
49+ this . addNodeState = [ { property : '' , value : '' , valueType : 'string ' } ] ;
5150 }
5251
5352 async submitHandler ( e ) {
@@ -56,7 +55,9 @@ export class InsertNodeModal {
5655
5756 handleChange ( event , key , index ) {
5857 if ( key === 'value' ) {
59- this . propSelectedOptionLabel = / ^ - ? \d + \. ? \d * $ / . test ( event . target . value ) ? 'Number' : 'String' ;
58+ const copyAddNodeState = [ ...this . addNodeState ] ;
59+ copyAddNodeState [ index ] [ "valueType" ] = / ^ - ? \d + \. ? \d * $ / . test ( event . target . value ) ? 'Number' : 'String' ;
60+ this . addNodeState = copyAddNodeState ;
6061 }
6162 this . addNodeState [ index ] [ key ] = event . target . value ;
6263 }
@@ -163,7 +164,7 @@ export class InsertNodeModal {
163164 </ div >
164165 < custom-drop-down class = "py-4" selectHandler = { value => this . handleCustomSelect ( value ) } optionListProp = { this . nodeMapper ( ) } > </ custom-drop-down >
165166 < div class = "max-h-60 overflow-auto custom-scrollbar" >
166- { this . addNodeState . map ( ( _node , index ) => {
167+ { this . addNodeState . map ( ( node , index ) => {
167168 return (
168169 < div class = "mt-2 flex gap-4" >
169170 < div >
@@ -201,7 +202,7 @@ export class InsertNodeModal {
201202 < basic-dropdown
202203 label = "Select:"
203204 propOptions = { this . valueOptions }
204- propSelectedOptionLabel = { this . propSelectedOptionLabel }
205+ propSelectedOptionLabel = { node [ "valueType" ] }
205206 optionHandler = { selectedLabel => this . optionHandler ( index , selectedLabel ) }
206207 class = "w-40"
207208 id = "valueType"
0 commit comments