Multi-Select Losing State (with HTML option)

I think a large portion of the filament community relies on this old but spectacular post for using images in Form Select fields: https://v2.filamentphp.com/tricks/render-html-in-select-options Which now appears broken which means I bet many devs have a half working form at the moment. This is only true for ->searchable() and ->multiple()
I'm not sure if it was always broken or if something changed in the way Filament v3 handles form state, but: If you use this "trick" by Matthew Ost, now this technique loses state with each new search in the select box. At first glance the select appears to work, but if you use more than one search query, the select field removes the previously selected items. It looks like the previously generated HTML that existed inside the Select field gets converted to the previously selected search term further confusing the Select form state. I was first alerted to this when I noticed that every once and a while this Select option was trying to save data with an ID = 0. Anyone else notice this behavior? (and possibly have a fix?)
Filament
Render HTML in select options by Matthew Ost - Tricks - Filament
Filament is a collection of tools for rapidly building beautiful TALL stack apps, designed for humans.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?