FilamentF
Filament3y ago
Remi

live fields updating other field lags and created mistakes

I have a "name" field which is reactive and on updating this field, the slug field is updated to a slugified version of this field. But since v3, there appears to be a lag on updating, and when you type fast, letters get lost and the words get messed up.


the code:
Forms\Components\TextInput::make('name')
                    ->live()
                    ->required()
                    ->string()
                    ->maxLength(250)
                    ->afterStateUpdated(function ($state, Forms\Set $set) {
                            $slug = Str::slug($state);
                            $set('slug', '/' . $slug);
                    }),

                Forms\Components\TextInput::make('slug')
                    ->required(),


attached is a video of the error.

Any ideas?
Was this page helpful?