F
Filament15mo ago
TiBiBa

Unable to dynamically update own state of RichEditor for component?

Hi! For a form I would like to process the input data of a RichEditor using the afterStateUpdated() hook. The data is processed and a HTML table structured string is return, that is supposed to be set as the value of the editor itself. The purpose is to enable pasting data from excel and we render this nicely as preview. The following snippet used to work fine in v2:
RichEditor::make('users')->live()
->disableAllToolbarButtons()
->afterStateUpdated(function (Set $set, Get $get) {
$userData = self::parseExcelData($get('users'));
$set('users', self::parseTableData($userData));
}),
RichEditor::make('users')->live()
->disableAllToolbarButtons()
->afterStateUpdated(function (Set $set, Get $get) {
$userData = self::parseExcelData($get('users'));
$set('users', self::parseTableData($userData));
}),
However, the form field is not updated when providing some input. I already verified that the last function, parseTableData(), returns data as expected. Weirdly enough, an identical implementation but with a TextInput works just fine! Anyone a clue how this can be fixed? Thanks in advance!
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server