F
Filament12mo ago
lupoz

live method trim himself

When I compile name field, slug and title are update, but the last two chars of name are trimmed:
TextInput::make('name')
->columnSpan(10)
->required()
->placeholder('Love')
->live()
->afterStateUpdated(fn ($state, callable $set) => [
$set('title', 'Books about ' . $state),
$set('slug', Str::slug('Books about ' . $state))
]),
TextInput::make('name')
->columnSpan(10)
->required()
->placeholder('Love')
->live()
->afterStateUpdated(fn ($state, callable $set) => [
$set('title', 'Books about ' . $state),
$set('slug', Str::slug('Books about ' . $state))
]),
6 Replies
lupoz
lupozOP12mo ago
No description
Ben
Ben12mo ago
I think you need reactive()
lupoz
lupozOP12mo ago
same problem with lazy() works but it is not in real time
sadiqgoni13
sadiqgoni1312mo ago
i also have same problem ,try ->debounce(900)
lupoz
lupozOP12mo ago
solved thanks!
sadiqgoni13
sadiqgoni1312mo ago
You are welcome
Want results from more Discord servers?
Add your server