Open tdudgeon opened 8 years ago
When values disappear from a cell is because there's an Ajax refresh where the cell is replaced with the state of the model at the server. Since there wasn't a submit, the models are not updated at the server, and when the refresh occurs, previous values (in this case empty values) are used. So the fix for this situation is to trigger a cell's form submit whenever we want to "save" currently entered values at the browser. Probably the case of the connection is solvable, triggering the submission right before the roundtrip to add the connection. I also found that deleting a cell, which triggers a global update, causes the same problem. Before we start work on a solution, can you think of other cases when this happens?
I think there probably are other cases, but it's difficult to track them all down. Certainly a page refresh would cause the same thing. Probably this need to be handled when the cell loses focus? Maybe we need some sort of event queue where the save event get added to the queue but only get's executed when a later event (e.g. execute) get's added that needs to go to the server? (this might avoid unnecessary saves as a series of save events can be condensed down to a single save event?)
There are cases when the cell options you set are lost. Most obviously this happens if you set options as soon as you add the cell to canvas and then connect an input - the options are lost