I'm doing some tests with input nodes for a helper app on an RPG character builder.
I have a form that looks like this:
I have several input fields, a few buttons, and a table displaying what I have in an SQL database (minus some fields like the ID value and so on). All the text input fields have a delay of 0, so they will only send their value when I press enter. I also selected the option to send the value when they lose focus (so if I use tab, they should send the value).
When I input a value in one of the fields, that value is sent to the corresponding property in an object that is stored in global context. After I'm done, I click "Add to database", and that object is pushed into a MySQL DB. After that, I clear the form by sending a message to each input nodes, and I send a query to fetch all the data in the MySQL DB table, sorted alphabetically, to update the table content.
Once that is done, if I click on the table, I get the values for that line as an object. In my flow, I use them to update the input fields again, and because the value passes through, the values are updated in the current global context. Until here, everything is fine.
And here's the issue: I noticed that the behaviour of the text input node is not the same if the input value is empty or it already has a value.
If the text input is empty (when I am creating a new entry, for instance), typing something and then using tab or clicking somewhere else to change focus will send a message. Normal behaviour.
However, if I initialise the values of the text input node by sending a message with the payload, the msg passes through and updates the value in global context. After that, if I edit the text and use the tab or click on another text input node to change focus and continue editing, or I click on the button to send the values to the DB, the message with the edited value is NOT sent, and the field retains its old value in global context (because it's not updated).
If I press enter, the value is always sent, no matter if the input node has been initialised or not, so it always works as it supposed to.
Is it a bug?