KeyValue UI not updating after $set(), but the value is changed
Hi Guys,
I am using a button to change the keys and/or values in a KeyValue field that already contains data.
When i do this the UI does not change, but the value will.
The weird thing is that it works when the meta field is either NULL or an empty array, OR when i manually make a change to the KeyValue field first.
Am i doing something wrong or is this a bug?
Thanks in advance!
demo repo:
https://github.com/rickzim/demo-filament-key-value
GitHub
GitHub - rickzim/demo-filament-key-value
Contribute to rickzim/demo-filament-key-value development by creating an account on GitHub.
4 Replies
Try using
$this->refreshFormData('meta')
in the action code. This should refresh the form data for the meta attribute
https://filamentphp.com/docs/3.x/panels/pages#refreshing-form-dataThis sadly does not work. I think you would normally use this when you want to refresh the main form to reflect changes you made from, for example a header action.
how about adding
->live()
to the KeyValue form field
I tried many different combinations but i couldn't get it to work.