vis network double click edit the data

I am trying to create a network graph dynamically using the vis.js library. When I create each node and edge, I want to double click in them and show a pop up window to enter some extra information.
I have made this, but my problem is when I double click again in the same edge/node the information does not store and I lost them. Can you help me with this? I want to keep my previous data and edit the data if the user wants.
Thank you!
I have use this link for my stimulation vis network stimulation

I have add this function to achieve the double click

enter code here document.getElementById("eventSpanHeading").innerText = "doubleClick event:";
      if(data.nodes.length){
       
        document.getElementById("node-operation").innerText = "Add Node Data";
        editNode(data,clearNodePopUp,callback);
        
        
      }
      if(data.edges.length){
        document.getElementById("edge-operation").innerText = "Add Edge Data";
        editEdgeWithoutDrag(data,clearEdgePopUp,callback); 
       
       
      }