ToggleButtons problem can anyone check if the multiple option is still working?
If you create a simple ToggleButtons field like this
If I click "two" everything is selected? If I inspect the livewire data... the test is null instead of []
Am I missing something?
13 Replies
Filament v3.2.83
Laravel Framework 11.8.0
The options need to be an array of value => label
Hi Adam, Nope sorry not working as well... used the example in the docs to test this
https://filamentphp.com/docs/3.x/forms/fields/toggle-buttons#selecting-multiple-buttons
Where are you using the component? Ina resource or a standalone livewire component.
in a resource.. just plain Filament in a test project
Hmm. I haven’t seen any problems with them.
ok lemme ask a friend to check this in his project...
ok, i'm seeing the same with multiple on v3.2.83. so it's gotta be a bug.
ok... pfieuw... was driving me mad
thanks for checking
no problem. please submit it on GitHub. 🙂
yes will do
you woul not believe it... it works in the testrepo?? asked a friend of mine in his project... also seing the bug
ok... narrowed it down... If I use a fieldname that does not exist in the database it works on create... but if you edit a resource it's not working anymore.. I think because it sets the value to null somewhere
is there a use case you would use a fieldname which is not in the database? only for advanced purposes I think?
is it handy to propose a change in the ToggleButtons field? or first post the bug repo (don't really know if it's a bug... feels like a bug) and then propose a PR with the fix?
I changed
to
so if the value is null and it's a multiple field.. set the state to an empty string
we'll see... created the issue: https://github.com/filamentphp/filament/issues/12962
GitHub
Problem with multiple() in ToggleButtons · Issue #12962 · filamentp...
Package filament/filament Package Version v3.2.83 Laravel Version 11.8.0 Livewire Version No response PHP Version PHP 8.3.3 Problem description If I'm using the example from the docs Forms\Comp...