Update a KeyValue field

in V2 I was able to update a KeyValue field like so:
Forms\Components\TextInput::make('test1')
->live()
->afterStateUpdated(function (Forms\Get $get, Forms\Set $set) {
$set('test2', [
'txt' => $get('test1'),
]);
}),

Forms\Components\KeyValue::make('test2')
->default(['txt' => '']),
Forms\Components\TextInput::make('test1')
->live()
->afterStateUpdated(function (Forms\Get $get, Forms\Set $set) {
$set('test2', [
'txt' => $get('test1'),
]);
}),

Forms\Components\KeyValue::make('test2')
->default(['txt' => '']),
But that doesn't seem to work anymore... I can't figure out how to update the values :/
0 Replies
No replies yetBe the first to reply to this messageJoin