is it possible to disable form while image is uploading?
the field state goes uncompleted after image upload. is there any way to disable the form while image is uploading?
6 Replies
@Leandro Ferreira Thanks for reply. but the form doesn't have this method. I need to add this method to all fields in the form.
Call to undefined method Filament\Resources\Form::extraAlpineAttributes()
actually you can use this method by field
TextInput::make('title')->extraAlpineAttributes([':disabled' => 'isUploadingFile'])
Yeah, it works by field. However, I'm curious to find a way to disable the form while the form is uploading file. Perhaps a trait for all models would be nice to achieve this. You know, I have a lot of forms and fields in the app.
not sure if it is the right way to do that but you can use
configureUsing
to apply global settings
https://filamentphp.com/docs/2.x/forms/fields#global-settingsSolution
@Leandro Ferreira Your hint was helpful.
I solved it this way:
I am not sure if it is the best practice . but it seems works.
thank you.