Skip to content

Commit

Permalink
Fixed improper null checks on number input component properties (#1013)
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-nimbleapproach authored Feb 11, 2025
1 parent 3d7abd6 commit c69c525
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@

@{
var showError = !string.IsNullOrWhiteSpace(Model.ErrorMessage);
var showSuffix = !string.IsNullOrWhiteSpace(Model.Suffix);
var showLabel = !string.IsNullOrWhiteSpace(Model.Label);
}
@{
if(Model.Label.Length > 0)
if (showLabel)
{
<div class="govuk-heading-s">@Model.Label</div>
}
}
<div class="govuk-form-group @(showError ? "govuk-form-group--error" : "")">
@{
if (Model.Suffix.Length > 0)
if (showSuffix)
{
<div class="govuk-input__wrapper">
<input class="govuk-input govuk-input--width-3 @(showError ? "govuk-input--error" : "")"
Expand Down

0 comments on commit c69c525

Please sign in to comment.