Widget Live form

Hey Guys,

tried to add a form in a widget (with HasForms / InteractsWithForms) but unfortunately there is no live update on change. Is it not possible to do a live Form-Field?

<?php

namespace App\Filament\User\Widgets;

use Filament\Forms\Components\TextInput;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Forms\Contracts\HasForms;
use Filament\Forms\Form;
use Filament\Widgets\Widget;

class Testwidget extends Widget implements HasForms
{
    use InteractsWithForms;

    protected static string $view = 'filament.user.widgets.testwidget';

    public function form(Form $form)
    {
        return $form->
            schema([
                TextInput::make('test')
                    ->live()
                    ->afterStateUpdated(fn () => dd('test')),
            ]);
    }
}


B lade File:
<x-filament-widgets::widget>
    <x-filament::section>
        {{ $this->form }}
    </x-filament::section>
</x-filament-widgets::widget>
Solution
Oh my god - did the same mistake as in ❓┊helpAction inside a custom widget

The test variable must be set as public - only then the "afterStateUpdated" function will be called.
Was this page helpful?