© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
2 replies
Mansoor Khan

Possible Bug in Action ->disabled() and ->hidden()

I have added Filament action to a custom livewire page. The disabled function works a little odd, the condition changes to true/false but the ->action() would not execute.

If i remove the disabled(), it works as expected.

Can any one reproduce this?

public function nextPageAction(): Action
{
    return Action::make('nextPage')
        ->button()
        ->disabled(fn () => $this->totalPages <= 1 || $this->page === $this->totalPages)
        // ->hidden($this->totalPages <= 1 || $this->page === $this->totalPages)
        ->action(function () {
            dd($this->page);
            $this->nextPage();
        });
}
public function nextPageAction(): Action
{
    return Action::make('nextPage')
        ->button()
        ->disabled(fn () => $this->totalPages <= 1 || $this->page === $this->totalPages)
        // ->hidden($this->totalPages <= 1 || $this->page === $this->totalPages)
        ->action(function () {
            dd($this->page);
            $this->nextPage();
        });
}
Solution
My bad, the
totalPages
totalPages
must be a public property. I had
protected ?int $totalPages = null;
protected ?int $totalPages = null;
and changing it to
public ?int $totalPages = null;
public ?int $totalPages = null;
worked.
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

using hiddenOn and hidden in conjunction
FilamentFFilament / ❓┊help
3y ago
Bug? Actions show disabled when set to hidden
FilamentFFilament / ❓┊help
3y ago
Actions with ->hidden() showing disabled and not hidden inside infolists
FilamentFFilament / ❓┊help
5mo ago
Actions : disabled() and hidden() are the same
FilamentFFilament / ❓┊help
3y ago