Prevent concealed component check affecting input min/max behaviour?

I guess this is done to prevent the validation triggering on hidden inputs but there must be a better way of doing this than always adding it manually.
Section::make('Test')
->schema([
TextInput::make('length')
->required()
->integer()
->minValue(1),
]),
Section::make('Test 2')
->collapsible()
->schema([
TextInput::make('length2')
->required()
->integer()
->minValue(1),
TextInput::make('length3')
->integer()
->minValue(1)
->extraInputAttributes(['min' => 1]),
])
Section::make('Test')
->schema([
TextInput::make('length')
->required()
->integer()
->minValue(1),
]),
Section::make('Test 2')
->collapsible()
->schema([
TextInput::make('length2')
->required()
->integer()
->minValue(1),
TextInput::make('length3')
->integer()
->minValue(1)
->extraInputAttributes(['min' => 1]),
])
No description
9 Replies
Dennis Koch
Dennis Koch6mo ago
What's the actual issue you have with this approach?
exactwebitesolutions
@Dennis Koch I feel like it should be handled properly revealing the collapsed parent component instead of preventing the basic form validation min/max/required
Dennis Koch
Dennis Koch6mo ago
But those your addition change that?
exactwebitesolutions
Yeah you can manually add them but it seems a little backwards to lose this client-side validation and no mention of it in the documentation.
Dennis Koch
Dennis Koch6mo ago
Can you share a screenshot of what happens when you have a closed section and a validation error with ->extraInputAttributes(['min' => 1]),?
exactwebitesolutions
There's no client side validation because it's hidden.
Dennis Koch
Dennis Koch6mo ago
So what is the difference between your solution and Filament's solution if there is still no client side validation?!
exactwebitesolutions
Sorry not explaining very well. When the section is not hidden you get the client-side validation
Dennis Koch
Dennis Koch6mo ago
When the section is not hidden you get the client-side validation
Isn't that the same as what happens with the Filament code?
Want results from more Discord servers?
Add your server