Cannot close modal after validation

I have a page that shows a custom column: public function table(Table $table): Table { $user = auth()->user(); $client = Client::query()->where('id', $user->client_id)->first(); return $table ->query($client()->getQuery()) ->columns( [ ViewColumn::make('deadlines') ->label('Deadlines') ->view('filament.tables.columns.client.deadlines') ] ); } In the custom column Blade.php file, there is a modal that includes a header, content, and a Filament button to trigger a function called submit: <x-filament::modal :close-button="true" id="test" width="xl"> <x-slot name="heading"> Heading </x-slot> <!-- Modal Content --> <div> {{ $this->form }} </div> <x-slot name="footer"> <x-filament::button style="float: right;" wire:click="submit()"> Submit </x-filament::button> </x-slot> </x-filament::modal> This is the form: public function form(Form $form): Form { return $form ->schema([ \Filament\Forms\Components\TextInput::make('test_field')->required() ]); } This is the submit function: public function submit(): void { // Validate the data $validatedData = $this->form->validate(); } There is also a button to open the modal on click: x-on:click="$dispatch('open-modal', {id: 'test'})" Issue When I open the modal and click anywhere outside the modal, or on the close icon in the top right corner, the modal closes as expected. However, if I open the modal, leave the TextInput field blank, and click Submit, the submit button shows a spinning icon and then displays a validation error message. After the validation message is displayed, if I try to close the modal, it does not close.
37 Replies
gemini.dev
gemini.dev3w ago
Has anyone got any ideas?
awcodes
awcodes3w ago
Any errors in the dev console? Can’t imagine why livewire would just stop working unless alpine is somehow erroring out.
gemini.dev
gemini.dev3w ago
Thanks for the response, just having a look now, bear with me
awcodes
awcodes3w ago
No rush.
gemini.dev
gemini.dev3w ago
Nope, no errors. Even when clicking the close popup button.
No description
gemini.dev
gemini.dev3w ago
The click method is still there. I'll have a look to see what it looks like, before I click the "Submit" button. The issue of not closing the popup button, only occurs when clicking the "Submit" button.
No description
gemini.dev
gemini.dev3w ago
Appears to be identical
No description
awcodes
awcodes3w ago
Do you have any of the filament views published?
gemini.dev
gemini.dev3w ago
Sorry, how do you mean published?
awcodes
awcodes3w ago
Can you run php artisan about —filament
gemini.dev
gemini.dev3w ago
No description
awcodes
awcodes3w ago
It’s 2 - Try —only=filament
gemini.dev
gemini.dev3w ago
No description
awcodes
awcodes3w ago
Yep, you have views published.
gemini.dev
gemini.dev3w ago
What does this show me, out of curiosity?
Want results from more Discord servers?
Add your server