Error when prefilling from query string in resource with persistTabInQueryString enabled
Hi, I get the following error when persisting tabs in query string enabled when creating a form or uploading files inside the form: https://flareapp.io/share/xPQ3Xol5#F113
The query strings looks like this:
?event_start=2023-03-04&event_end=2023-03-04&tab=tabs-evenement-tab
, and the code for filling like this (not sure if it is the correct way to handle it):
Flare
Typed property Filament\Forms\Components\Component::$container must not be accessed before initialization - The error occurred at https://radiotherapie.test/berichten/aanmaken
10 Replies
And the code for the tabs:
Why not TextInput::make('event_start')->rules() ?
Not sure what you mean by
rules()
you can also use any other Laravel validation rules, including custom validation rules.
https://filamentphp.com/docs/2.x/forms/validation#getting-started
Filament
Validation - Form Builder - Filament
The elegant TALL stack form builder for Laravel artisans.
I don't understand what validation rules have to with my problem. My query string gets validated fine, but I get a
Typed property Filament\Forms\Components\Component::$container must not be accessed before initialization
when have the following enabled:
->persistTabInQueryString('tab')
afterStateHydrated in an option to to customize what happens after a field is hydrated: https://filamentphp.com/docs/2.x/forms/advanced#hydration
May be you can try another way
Tried it that way but it's still not working. It seems like a bug in Filament. @Dan Harrin Any thoughts about it? Should I make an issue in the github repo?
sure, but please make a simple reproduction repository instead of the code you posted above
Sure!