Table text filter not showing indicator
I have the following table filter:
The filter works but no indicator shows in the filter section nor on the filter badge count. I just want to make sure I'm doing this right before opening an issue.
Thanks.
Solution:Jump to solution
I looked into it and it's not a bug per se...
Filter
by default is a checkbox form component which means it either has an active
or inactive
state. Think is_visible
or is_featured
. The default indicator for this default state is to use the label()
or indicator()
. However, if you add a custom form field to this Filter, it then expects it to have indicateUsing()
to show the filter.
I've made a PR to clarify the docs: https://github.com/filamentphp/filament/pull/7889...GitHub
[Docs] Clarify using a custom indicator with filter forms by archil...
Using indicator() to define an active indicator doesn't work with custom filter forms. This adds a clarifying sentance so devs know to use indicateUsing() to show an active indicator.
3 Replies
Seems like it's a bug. It works with using
->indicateUsing()
, but it should default to using label
and then indicator
, but neither of those two seem to be working, just ->indicateUsing()
.
Since I'm looking at filters right now, I'll take a look in a bit and submit a PR if I can find the problem and fix it.Solution
I looked into it and it's not a bug per se...
Filter
by default is a checkbox form component which means it either has an active
or inactive
state. Think is_visible
or is_featured
. The default indicator for this default state is to use the label()
or indicator()
. However, if you add a custom form field to this Filter, it then expects it to have indicateUsing()
to show the filter.
I've made a PR to clarify the docs: https://github.com/filamentphp/filament/pull/7889GitHub
[Docs] Clarify using a custom indicator with filter forms by archil...
Using indicator() to define an active indicator doesn't work with custom filter forms. This adds a clarifying sentance so devs know to use indicateUsing() to show an active indicator.
Thanks @kennethsese I appreciate you looking into it. Planning to get Filter Sets after making a little more progress.