Robinson
Robinson
FFilament
Created by Robinson on 10/19/2023 in #❓┊help
Select::maxItems() is not reactive?
Hello, guys Why is method maxItems not reactive? The new item limit is not updated in the select, according to the value placed in the input.
TextInput::make('max_items_input')->live(onBlur: true),

Select::make('technologies')
->multiple()
->options([
'tailwind' => 'Tailwind CSS',
'alpine' => 'Alpine.js',
'laravel' => 'Laravel',
'livewire' => 'Laravel Livewire',
])
// It doesn't work
->maxItems(fn (Get $get): int => $get('max_items_input') ?? 1)
// It works
->helperText(fn (Get $get): string => $get('max_items_input') ?? 1)
TextInput::make('max_items_input')->live(onBlur: true),

Select::make('technologies')
->multiple()
->options([
'tailwind' => 'Tailwind CSS',
'alpine' => 'Alpine.js',
'laravel' => 'Laravel',
'livewire' => 'Laravel Livewire',
])
// It doesn't work
->maxItems(fn (Get $get): int => $get('max_items_input') ?? 1)
// It works
->helperText(fn (Get $get): string => $get('max_items_input') ?? 1)
4 replies