Dark
Dark
FFilament
Created by Dark on 1/23/2024 in #❓┊help
Select (native: false) disabled but user can choose options
@awcodes @Leandro Ferreira Should I mark the post as resolved, or should I leave it to see if there is a bug?
32 replies
FFilament
Created by Dark on 1/23/2024 in #❓┊help
Select (native: false) disabled but user can choose options
thanks for the help
32 replies
FFilament
Created by Dark on 1/23/2024 in #❓┊help
Select (native: false) disabled but user can choose options
it disables the select and transform it to non-searchable (so, non-native) and the user cannot click on it
32 replies
FFilament
Created by Dark on 1/23/2024 in #❓┊help
Select (native: false) disabled but user can choose options
yep that does the trick
32 replies
FFilament
Created by Dark on 1/23/2024 in #❓┊help
Select (native: false) disabled but user can choose options
Yes for dependant selects, and if I remove searchable it does work
32 replies
FFilament
Created by Dark on 1/23/2024 in #❓┊help
Select (native: false) disabled but user can choose options
I will try ASAP and let you know
32 replies
FFilament
Created by Dark on 1/23/2024 in #❓┊help
Select (native: false) disabled but user can choose options
No description
32 replies
FFilament
Created by Dark on 1/23/2024 in #❓┊help
Select (native: false) disabled but user can choose options
yep didn't understand too, I am trying to found an explanation 😅
32 replies
FFilament
Created by Dark on 1/23/2024 in #❓┊help
Select (native: false) disabled but user can choose options
oh I thought you were speaking about the project sorry, here is the link: https://flareapp.io/share/353vJpo7/claim/u6uUrQyviOW1qqURquMH1KMAV8xI41Mx
32 replies
FFilament
Created by Dark on 1/23/2024 in #❓┊help
Select (native: false) disabled but user can choose options
it is not live, but you can see the whole code here: the component code: https://gist.github.com/heloufir/58f39335b877a7ded91dfbbe0e10d1a6 and the blade code: https://gist.github.com/heloufir/2e94f3ba6a5ce78a70f1524135f7a496
32 replies
FFilament
Created by Dark on 1/23/2024 in #❓┊help
Select (native: false) disabled but user can choose options
no, both of them works (passing true in a closure or not works) but when passing the function as a closure that does not work
32 replies
FFilament
Created by Dark on 1/23/2024 in #❓┊help
Select (native: false) disabled but user can choose options
Yep, I debugged on that and I am sure, it disables the select but let the user click on the select and see the options. But if I put true without a closure, it works the select is disabled and the user cannot click on it
32 replies
FFilament
Created by Dark on 1/23/2024 in #❓┊help
Select (native: false) disabled but user can choose options
No description
32 replies
FFilament
Created by Dark on 1/23/2024 in #❓┊help
Select (native: false) disabled but user can choose options
32 replies
FFilament
Created by Dark on 1/23/2024 in #❓┊help
Select (native: false) disabled but user can choose options
@Leandro Ferreira Yes I have this:
public function mount(): void
{
// ...

// Fill different forms
$this->timeRegistrationForm->fill();
}
public function mount(): void
{
// ...

// Fill different forms
$this->timeRegistrationForm->fill();
}
32 replies
FFilament
Created by Dark on 12/19/2023 in #❓┊help
requiresConfirmation not working on actions
@justlasse here is for my case: - Not working example: In my Livewire Component I have a function that returns all my actions as an array:
public function myActions(): array {
return [
Action::make('delete')
->requiresConfirmation()
->action(fn () => /* some logic */),

// Other actions
];
}
public function myActions(): array {
return [
Action::make('delete')
->requiresConfirmation()
->action(fn () => /* some logic */),

// Other actions
];
}
Then in my blade view, I loop then render the action:
@foreach($this->myActions() as $action)
@if($action->isVisible())
{{ $action }}
@endif
@endforeach

<x-filament-actions::modals />
@foreach($this->myActions() as $action)
@if($action->isVisible())
{{ $action }}
@endif
@endforeach

<x-filament-actions::modals />
that works, but like there is no confirmation, it fires directly the action method. - Now, the working example:
public function myDeleteAction(): Action {
return Action::make('delete')
->requiresConfirmation()
->action(fn () => /* some logic */)
;
}

public function myOtherAction(): Action {
return /* Action definition */
}
public function myDeleteAction(): Action {
return Action::make('delete')
->requiresConfirmation()
->action(fn () => /* some logic */)
;
}

public function myOtherAction(): Action {
return /* Action definition */
}
And for the blade view, I render them separatly:
@if($myDeleteAction->isVisible())
{{ $myDeleteAction }}
@endif

@if($myOtherAction->isVisible())
{{ $myOtherAction }}
@endif

<x-filament-actions::modals />
@if($myDeleteAction->isVisible())
{{ $myDeleteAction }}
@endif

@if($myOtherAction->isVisible())
{{ $myOtherAction }}
@endif

<x-filament-actions::modals />
And also a weird behaviour I found, is when you define your Action with the following format, it WORKS:
public function myDeleteAction(): Action {
return Action::make('delete')
->requiresConfirmation()
->action(fn () => /* some logic */) // The action is a function directly mentionned here
;
}
public function myDeleteAction(): Action {
return Action::make('delete')
->requiresConfirmation()
->action(fn () => /* some logic */) // The action is a function directly mentionned here
;
}
But with the following format it does not WORK:
public function myDeleteAction(): Action {
return Action::make('delete')
->requiresConfirmation()
->action('myDeleteActionHandler') // Mentionning the name of the handler
;
}

public function myDeleteActionHandler(): void {
/* some logic */
}
public function myDeleteAction(): Action {
return Action::make('delete')
->requiresConfirmation()
->action('myDeleteActionHandler') // Mentionning the name of the handler
;
}

public function myDeleteActionHandler(): void {
/* some logic */
}
So basically, you need to specify a function for each action, then for the requiresConfirmation you need to specify the action as an embedded method in the action()
53 replies
FFilament
Created by Dark on 12/19/2023 in #❓┊help
requiresConfirmation not working on actions
Yes sure, I will do it tonight when I have my laptop
53 replies
FFilament
Created by Dark on 12/19/2023 in #❓┊help
requiresConfirmation not working on actions
I found the solution, When using a function that defines an array of actions that did not work but when using a function that only defines a single Action it works So basically what it did work for me is to define a function for each Action that I have and follows the documentation here: https://filamentphp.com/docs/3.x/actions/adding-an-action-to-a-livewire-component/ And all works fine
53 replies
FFilament
Created by Dark on 12/19/2023 in #❓┊help
requiresConfirmation not working on actions
I am using Filament v3
53 replies
FFilament
Created by Dark on 12/19/2023 in #❓┊help
requiresConfirmation not working on actions
ow I see
53 replies