Error in documentation or code ( Select->allowHtml( ) )

I wanted to make use of the allowHtml() method in a Select box that I have made on one of my resource forms, but even when copying the documentation exactly I have been unable to get any HTML to display at all. I haven't made any custom css or edited any of the styling throughout the rest of the application. When I go to the inspector I can see the HTML is being applied but the styling is being overwritten by something, and from my investigation so far looks like its being overwritten by:
public/css/filament/forms/forms.css
public/css/filament/forms/forms.css
I'm hoping this is something that either I have done wrong or have overlooked in some regard, but it all seems to be correct. Here is the Select box that I was trying to make:
Select::make('status')
->label('Status')
->options([
'submitted' => '<span class="text-blue-500">Submitted</span>',
'accepted' => '<span class="text-green-500">Accepted</span>',
'rejected' => '<span class="text-red-500">Rejected</span>',
])
->allowHtml()
Select::make('status')
->label('Status')
->options([
'submitted' => '<span class="text-blue-500">Submitted</span>',
'accepted' => '<span class="text-green-500">Accepted</span>',
'rejected' => '<span class="text-red-500">Rejected</span>',
])
->allowHtml()
I did also try adding the searchable() method to it as well like in the docs in case it was restricted to just searchable objects, but that hasn't helped either.
2 Replies
greenrae94
greenrae94OP4mo ago
That's great to know, but it would help if it was indicated in the docs that you have to have a custom theme in order to get this to work. Especially considering that it reads like allowHtml is a working method right out of the box
Want results from more Discord servers?
Add your server