You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Package
filament/filament
Package Version
3.2
Laravel Version
11.9
Livewire Version
3.0
PHP Version
8.4
Problem description
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
Expected behavior
it should use disableOptionWhen right after selecting a option
Steps to reproduce
Follow the Reference video here
https://app.screencast.com/xevYk1zCI9WJK
Reproduction repository (issue will be closed if this is not valid)
https://github.com/dharen008/demo/blob/main/app/Filament/Resources/UserResource.php
Relevant log output
The text was updated successfully, but these errors were encountered: