Reactive textinputs is broken
Hello guys
I'm trying to do the same slug example in the docsbut I'm having a weird behavior where the title input is broken when I write let's say "Post Title" the text cuts off and some letters drops and some times it stops working
I have the latest filamnet v3 version on a fresh laravel project
6 Replies
share your code
This is behavior I'm talking about
class TaxonomiesResource extends Resource
{
protected static ?string $model = Taxonomy::class;
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
public static function form(Form $form): Form
{
return $form
->schema([
Section::make()->schema([
TextInput::make('name')
->autofocus()
->live()
->afterStateUpdated(fn (Set $set, ?string $state) => $set('slug', Str::slug($state)))
->required(),
TextInput::make('slug')
->columnSpan(1)
->required(),
])->columns(2),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('name')->searchable()->sortable(),
Tables\Columns\TextColumn::make('slug')->searchable()->sortable(),
])
->filters([
//
])
->actions([
Tables\Actions\EditAction::make(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
]),
]);
}
public static function getRelations(): array
{
return [
//
];
}
public static function getPages(): array
{
return [
'index' => ListTaxonomies::route('/'),
'create' => CreateTaxonomies::route('/create'),
'edit' => EditTaxonomies::route('/{record}/edit'),
];
}
}
try
->live(onBlur: true)
yes his will work fine but why without it it breaks
network request I think... you can also use debounce
https://filamentphp.com/docs/3.x/forms/advanced#debouncing-reactive-fields