Skip to content

Commit 2d5740a

Browse files
committed
Merge branch 'master' into dev/validation-warning
2 parents 6eba547 + 29f65ff commit 2d5740a

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

Source/Blazorise/Base/BaseInputComponent.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ protected virtual Task OnBeforeSetParametersAsync( ParameterView parameters )
165165
/// <returns>A task that represents the asynchronous operation.</returns>
166166
protected virtual async Task OnAfterSetParametersAsync( ParameterView parameters )
167167
{
168-
if ( ParentValidation is not null )
168+
if ( UsesValidation && ParentValidation is not null )
169169
{
170170
if ( paramValueExpression.Defined )
171171
await ParentValidation.InitializeInputExpression( paramValueExpression.Value );
@@ -818,6 +818,11 @@ protected virtual string GetFormatedValueExpression()
818818
/// </summary>
819819
protected bool UseValidationOnBlur => Options?.AccessibilityOptions?.UseValidationOnBlur == true;
820820

821+
/// <summary>
822+
/// Gets a value indicating whether this component should register itself as the input for the parent <see cref="Validation"/>.
823+
/// </summary>
824+
protected virtual bool UsesValidation => true;
825+
821826
/// <summary>
822827
/// Gets a value indicating whether an explicit <c>aria-labelledby</c> parameter was supplied.
823828
/// </summary>

Source/Blazorise/Components/Radio/Radio.razor.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ private async void OnRadioChanged( object sender, RadioCheckedChangedEventArgs<T
113113
/// </summary>
114114
protected bool ParentIsRadioGroup => ParentRadioGroup is not null;
115115

116+
/// <inheritdoc/>
117+
protected override bool UsesValidation => ParentRadioGroup is null;
118+
116119
/// <summary>
117120
/// True if radio should look as a regular button.
118121
/// </summary>

0 commit comments

Comments
 (0)