filament/filament
3.2
11.9
3.0
8.4
The disableOptionWhen feature has an issue in multiple select mode. It only works if the dropdown reloads, but if you keep selecting options without triggering onBlur or clicking outside the field, disableOptionWhen does not apply.
Reference video here
https://app.screencast.com/xevYk1zCI9WJK
Here's my code:
Select::make( 'options' ) ->options( [ 'Option 1' => 'Option 1', 'Option 2.1' => 'Option 2.1', 'Option 2.2' => 'Option 2.2', ] ) ->disableOptionWhen( function ( string $value, Get $get ) { if ( in_array( 'Option 2.1', $get( 'options' ) ) ) { return $value === 'Option 2.2'; } if ( in_array( 'Option 2.2', $get( 'options' ) ) ) { return $value === 'Option 2.1'; } } ) ->label( 'Select Multiple' ) ->multiple() ->required() ->live()
Here's the path to the demo file
app\Filament\Resources\UserResource.php
it should use disableOptionWhen right after selecting a option
Follow the Reference video here
https://app.screencast.com/xevYk1zCI9WJK
https://github.com/dharen008/demo/blob/main/app/Filament/Resources/UserResource.php
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too