Update RichEditor based on other field
I would like to pre-populate a RichEditor field if another field changes:
TextInput::make('Prompt')
->label(__('AI Assistant'))
->afterStateUpdated(function (Set $set,) {
$set('content', 'Foobar');
})
->live(onBlur: 500)
->columnSpan(2),
RichEditor::make('content')
->required()
->columnSpanFull(),
But it does not work. It works with a plain TextInput. What I'm doing wrong?Solution:Jump to solution
@rolandbarkoczi Can you check again, The same code is working on my machine, and click outside the input field after you have finished typing in Prompt field.
2 Replies
Solution
@rolandbarkoczi Can you check again, The same code is working on my machine, and click outside the input field after you have finished typing in Prompt field.
thanks for checking!
I was played a little bit. The problem occurs in that case when the richtext is just after the text field, and you hit TAB on the text field. in this case, the richtext will be focused and its value won't be updated