F
Filament11mo ago
Corvack

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.
return $form
->schema([
...
Forms\Components\KeyValue::make('meta'),
...
Forms\Components\Actions::make([
Forms\Components\Actions\Action::make('button')
->action(function (Set $set) {
$set('meta.a', 'foo');
$set('meta.b', 'bar');
$set('meta.c', 'baz');
}),
...
return $form
->schema([
...
Forms\Components\KeyValue::make('meta'),
...
Forms\Components\Actions::make([
Forms\Components\Actions\Action::make('button')
->action(function (Set $set) {
$set('meta.a', 'foo');
$set('meta.b', 'bar');
$set('meta.c', 'baz');
}),
...
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! 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.
No description
2 Replies
Corvack
CorvackOP11mo ago
bump
Panos
Panos3w ago
I am facing tje same issue. Have you had any luck figuring this out Corvack?
Want results from more Discord servers?
Add your server