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
Link to minimal reproduction or a simple code snippet
Steps to reproduce
What is expected?
Validation should work.
What is actually happening?
When using DatePicker with @bind-Dates (selection mode Range or Multiple) the validation does not work and I get error:
Unable to determine the validator type.
After looking in the source it seems like only the Date input is initialized for validation in SetParametersAsync (DatePicker.razor.cs), thus Dates input validation will not work. Probably need this:
if ( parameters.TryGetValue<Expression<Func<TValue>>>( nameof( DatesExpression ), out var datesExpression ) )
await ParentValidation.InitializeInputExpression( datesExpression );
Workaround: inherit DatePicker and override SetParametersAsync:
public override async Task SetParametersAsync(ParameterView parameters)
{
if (parameters.TryGetValue<Validation>(nameof(ParentValidation), out var parentValidation) && parentValidation is not null)
{
if (parameters.TryGetValue<Expression<Func<IReadOnlyList<TValue>>>>(nameof(DatesExpression), out var expression))
{
await parentValidation.InitializeInputExpression(expression);
}
}
await base.SetParametersAsync(parameters);
}
What browsers do you see the problem on?
No response
Any additional comments?
No response
The text was updated successfully, but these errors were encountered:
Blazorise Version
1.5.2
What Blazorise provider are you running on?
None
Link to minimal reproduction or a simple code snippet
Steps to reproduce
What is expected?
Validation should work.
What is actually happening?
When using
DatePicker
with@bind-Dates
(selection mode Range or Multiple) the validation does not work and I get error:After looking in the source it seems like only the
Date
input is initialized for validation inSetParametersAsync
(DatePicker.razor.cs), thusDates
input validation will not work. Probably need this:Workaround: inherit
DatePicker
and overrideSetParametersAsync
:What browsers do you see the problem on?
No response
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: