conditionally hidden section not working due to searchable() on select
I'm trying to conditionally hide a section on a form, and it was working yesterday, and now it's not working. If I remove
->searchable()
from the select, it works as expected.
The only thing I've changed since yesterday is I added some logic to the CreateRecord
class to handle getting the vendors, but even if I remove the references to that and just hardcode some options, it still doesn't work.5 Replies
stripping everything out and just using this as the select doesn't work when I include the searchable option:
Maybe you can use disabled()
same result
Oddly, another field isn't getting the value of the select when searchable option is used:
But when I comment out the searchable option, it works fine.
It seems unlikely, but It's almost like the selected event isn't fired when searchable is used, or something...I dunno..
Created another test resource to see if I could replicate it elsewhere in a simplified form and it's working there, so I have no idea what's going on..
I think I've experienced a related issue.
The
searchable
method makes the select component using the non-native select element (the browser native <select>; this is because the native element does not support search feature so a custom javascript one is used - Choices.js). I think you will get the same issues using ->native(false)
, even without ->searchable()
.
I found some github issue related to this, but I'm not figured out the solution yet.
Just an example: https://github.com/filamentphp/filament/issues/8097
I don't know if this info are still valid or outdated, just giving you some hints I foundGitHub
Select doesn't honor
disabled
· Issue #8097 · filamentphp/filamentPackage filament/filament Package Version v3.0.34 Laravel Version v10.20.0 Livewire Version No response PHP Version PHP 8.1.0 Problem description The Select field is still clickable and a new optio...
good catch....i hadn't considered that as being the root cause, but it makes sense...I ended up just giving up on it for now :/