diff --git a/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/periodisk-redovisning-form/periodisk-redovisning-form.component.html b/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/periodisk-redovisning-form/periodisk-redovisning-form.component.html index 92e4853..cc46089 100644 --- a/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/periodisk-redovisning-form/periodisk-redovisning-form.component.html +++ b/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/periodisk-redovisning-form/periodisk-redovisning-form.component.html @@ -127,25 +127,18 @@ [afLabel]="activitiesFormArrayMetadata[i].name" >
-
- -
- - {{activityFormGroup.errors.hours}} - -
-
+
0 && Number.isInteger(+hours) && +hours >= 0 && +hours <= 200; + const isValidHours = Number.isInteger(hours) && hours >= 0 && hours <= 200; if (isSelected && !isValidHours) { errors = { diff --git a/libs/ui/src/input/input.component.ts b/libs/ui/src/input/input.component.ts index fa4f200..f423b59 100644 --- a/libs/ui/src/input/input.component.ts +++ b/libs/ui/src/input/input.component.ts @@ -75,7 +75,7 @@ export class InputComponent implements AfterViewInit, ControlValueAccessor, OnCh } checkForChange(rawValue: string): void { - const value = this.uiType === UiInputType.NUMBER ? +rawValue : rawValue; + const value = this.uiType === UiInputType.NUMBER ? (rawValue !== '' ? +rawValue : null) : rawValue; if (this._value !== value) { if (this.onChange) { this.onChange(value);