Forms\Components\Select::make('country_id') this dropdown is lagging
I have images that it take 5 sec to get it correct drowdown and i try many cache command
php artisan view:cache php artisan route:cache php artisan config:cache php artisan icons:cache
This is the code
Forms\Components\Section::make('Address Details') ->schema([ Forms\Components\Select::make('country_id') ->relationship(name: 'country', titleAttribute: 'name') ->searchable() ->preload() ->multiple() ->required(), Forms\Components\Select::make('state_id') ->relationship(name: 'state', titleAttribute: 'name') ->searchable() ->preload() ->multiple() ->required(), Forms\Components\Select::make('city_id') ->relationship(name: 'city', titleAttribute: 'name') ->searchable() ->preload() ->multiple() ->required(), Forms\Components\Select::make('department_id') ->relationship(name: 'department', titleAttribute: 'name') ->searchable() ->preload() ->multiple() ->required(), ])->columns(3),
There are too images are attach there image where it takes time to load or lag and in 5 sec than it get corrected it self
Need your help
17 Replies
Do you by any chance use the Adblocker extension?
No i checked.
Have you tried disabling the view collector from debugbar? As the filament renders out a bunch of views the debugbar usually causes the page to slow down a bunch.
Try to publish the configuration:
php artisan vendor:publish --provider="Barryvdh\Debugbar\ServiceProvider"
and in the config/debugbar.php find the collectors array and set the views => false
okay, let me try once
hi now there is difference in it but then too it is visible issues i cant take screenshots because it is fast, the issue get self corrected, need more help in it
Yeah you mean you see the select being initialized?
like this?
YES YES YES
PLEASE HELP ME IN THIS
Yeah, it does that because it's
searchable()
, which means it doesn't use the native select, but uses their customizable select instead. And that needs to load in.
I'm not sure if you can fix that in a way. I think that needs to be preloaded by Filament itself.
Or making a completely custom select.
I'm relatively new to Filament, I assume others might know moreThanks for your tip, Brian
NEED MORE HELP IN THIS MATTER, Filament Expert kindly look into this master
that's just the browser and how long it takes to load the js and run it. There's not really anything you can do about it. Alpine components are loaded asynchronously, so when you're not in dev mode or have dev tools open the browser will cache the js file and it will be faster.
Sir, you have seen this correct its happening to me in my saas application so what is the alternative or solution for this dropdown thing
I did get your point, but then too, I have some doubts about using the filament panel form dropdown, in case it also reacts the same way in production too, then what?
Need your advice in this matter
my advice is that it is ok. there's nothing you can do about it. nor can you control your users internet speeds.
or make your own dropdown component that doesn't use async loading and instead loads with every page regardless of if the component is being used or not.
Then you say it's not an issue, correct?
If it is not, then I can proceed with it and check later if it is working fine on live.
it's not an issue in my eyes.
Thanks for your Support, Sir, Having fun using π