field value disapear during my slug generation

This is my field code: TextInput::make('name') ->required() ->label('Nom de la chambre') ->live(onBlur: true) ->afterStateUpdated(fn(?string $state, Set $set) => $set('slug', SlugService::createSlug(Lodging::class, 'slug', $state ?? '', ['unique' => true])))
Like the video show, during the time during the slug is generated, if the user continue to fill the form, it will remove all. Not a good experience for the user. How can I ovoid this ?
5 Replies
Frédéric
Frédéric5d ago
Hello ! No one ?
Frédéric
Frédéric4d ago
Thx for the answer but not the best solution. I can't just specify the input to updat and not update the other ?
toeknee
toeknee4d ago
You have to disable the inputs based on loading. Most of the time it's quick enough to not notice / delay of the changes