© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
7 replies
Mike

Viewfield not updating state

I'm using tiptap editor as it fits my needs. I created a hintAction in order to display a content preview modal. The issue is that the viewfileld data does not update the state when 'content' data is changed. Code as per below:
                                TiptapEditor::make('content')
                                    ->required()
                                    ->disk('s3')
                                    ->live()
                                    ->afterStateUpdated(function (Forms\Get $get, Set $set) {
                                        $set('post_content', $get('content'));
                                    })
                                    ->hintAction(
                                        Forms\Components\Actions\Action::make('preview')
                                            ->label('Preview Post')
                                            ->icon('heroicon-s-eye')
                                            ->form([
                                                PreviewPost::make('post_content')
                                                    ->label('')
                                                    ->live()
                                                    ->viewData([
                                                        'post_content' => $form->model->content
                                                    ]),
                                            ])
                                            ->modalSubmitAction(false)
                                            ->modalCancelActionLabel('Close')
                                    )
                                TiptapEditor::make('content')
                                    ->required()
                                    ->disk('s3')
                                    ->live()
                                    ->afterStateUpdated(function (Forms\Get $get, Set $set) {
                                        $set('post_content', $get('content'));
                                    })
                                    ->hintAction(
                                        Forms\Components\Actions\Action::make('preview')
                                            ->label('Preview Post')
                                            ->icon('heroicon-s-eye')
                                            ->form([
                                                PreviewPost::make('post_content')
                                                    ->label('')
                                                    ->live()
                                                    ->viewData([
                                                        'post_content' => $form->model->content
                                                    ]),
                                            ])
                                            ->modalSubmitAction(false)
                                            ->modalCancelActionLabel('Close')
                                    )


There might be a better solution to mine but this is what i could come up with
Solution
Resolved it using $get thank you
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

State not updating
FilamentFFilament / ❓┊help
2y ago
viewfield
FilamentFFilament / ❓┊help
3y ago
Liveware inputs not updating state
FilamentFFilament / ❓┊help
3y ago
Update viewfield state with placeholder addition values
FilamentFFilament / ❓┊help
2y ago