Field state is lost on save to JSON columns when invisible
Hi all. Not sure if I'm doing something wrong, but fields that are conditionally hidden using
->visible
are getting nulled when saving them to a JSON column.
For example let' say I have this:
If I already have something in the text field, then switch the toggle to off and re-save, the value in data.group1.my_text
(the text field) is removed. It's as if the field value is set to null when ->visible()
is false. Is that normal? I need to be able to hide the dependent field without losing the data on save. Any ideas?1 Reply
On further investigation, it looks like the values of hidden fields aren't present in the state. So I guess we have to merge the new and existing data before saving to JSON columns?