search highlight
Hi, is there any way to add matching text highlights to table search. It's way better for UX. We can see an example of it on this forum search as well.
10 Replies
bump
not without a custom integration
we can do it internally. I have made a function to highlight the text.
we have to get the searchable attributes and run them through the highlightMatch function with the search term
Kindly review it
I’m sure this is fine, but you’ll probably need a custom search input / component to have control over running the results though your function. That’s what I was getting at.
I don’t think Filament’s gloabal search has a way to hook into it at that particular point. I could be wrong though.
I was thinking about table search
Hmm, table search doesn’t show a preview though. The search is the content of the table. So, highlighting inside of column data is going to be an actual nightmare.
you have to pass the searchable column data into the highlightMatch() function. we already know which columns are searchable, so it shouldn't be an issue to do it natively in Filament I guess
So, what’s the question? Lol.
How can the highlightMatch function be implemented with table searchable columns? I can make a PR if you guide me in the right direction
I don’t think it’s relevant to core, personally. Showing that doesn’t make sense to me personally in the context of a table.
It makes sense in the context of a global search though.