Skip to content

Commit

Permalink
Disable search button when there are any validation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
terrajobst committed Jul 6, 2020
1 parent 5f180b7 commit cfe442b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ApiReview.Client/Pages/Notes.razor
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
</div>
<div class="form-group row">
<div class="col-sm-10">
<button class="btn btn-secondary" disabled="@(EndValidationMessage != null || IsLoading)" @onclick="FindIssuesAsync">Find Issues</button>
<button class="btn btn-secondary" disabled="@(!CanSearch)" @onclick="FindIssuesAsync">Find Issues</button>
</div>
</div>

Expand Down Expand Up @@ -129,6 +129,10 @@ else if (Summary != null)
private string DateValidationMessage { get; set; }
private string StartValidationMessage { get; set; }
private string EndValidationMessage { get; set; }
private bool HasValidationErrors => DateValidationMessage != null ||
StartValidationMessage != null ||
EndValidationMessage != null;
private bool CanSearch => !HasValidationErrors && !IsLoading;

private bool IncludeVideo { get; set; }

Expand Down

0 comments on commit cfe442b

Please sign in to comment.