Form Select with options(MyEnum::class) and multiple() has livewire error when removing a value.
Error I am getting : "__rm__" is not a valid backing value for enum
Setup is a basic enum that implements Filament\Support\Contracts\HasLabel.
Cast to convert it to json in the DB.
on the Resource:
Any clues, or am I just trying to do something weird and is there a better implementation ?
10 Replies
Can you paste/attach your enum here?
This is the enum:
iirc, "rm" is an internal LW tracker for removing items when dom diffing. seems really odd to me that the enum is trying to use it.
the select is flagged as multiple(), so I can 'remove' stuff from the select.
yea, i don't think you're doing anything wrong. I'm just surprised that LW is trying to assign it as a value in the options array
can you run
php artisan about
and let us know which versions of Filament and Livewire are installed.
I'm in the middle of upgrade an existing project, so should all be relative up-to-date
this used to work in v2
It should be working fine. I haven't had any issues with using enums in v3.
that's why i'm trying to figure this out, because it doesn't make sense.
filament is up to 3.0.62. maybe composer update will resolve the issue. not sure.
Livewire version is fine.
upgrading doesn't help
I can setup a repro If you like, or report in github ?
Report it with a reproduction repo, please. It's very strange.
GitHub
Form Select with enum options and multiple generates an error when ...
Package filament/forms Package Version v3.0.62 Laravel Version 10.24.0 Livewire Version v3.0.5 PHP Version 8.1.16 Problem description I have a basic Enum with a cast to convert it to json in the DB...