If you start editing a text field in a table and then click on another input form, such as a checkbox or a button, it won’t unfocus the text field (which is probably a bug in coda).
And any changes to the text field are only saved when you unfocus it.
Why is it a problem?
Let’s say you have a text field as an input and a “confirmation button”. (The simplest example of this is interface for creating new rows)
In order for this button to work correctly, you would need to click somewhere else on the document before clicking it. Not only is this rather annoying, but it’s very likely that in a hurry you forget to do that and inputted data will be parsed incorrectly.
There is a pretty simple solution to this which uses hidden formulas.
The idea is to open url of the currently displayed table/view and then adding a small delay with the
_Delay() function before launching the actual action on the button. The delay is required in order for the value of the text field to be updated when the actual action is being executed.
The minimal delay that I found working was 9ms, however I recommend setting it to 50ms just to be safe, since the difference is completely unnoticeable. This delay works even if there are slow calculation formulas using the input cel.
So if the button had previously this formula:
The updated formula would look like this:
You can play around with this hack in the document below.