From 30cb5a97d01a6e40896dc7b82d16449f8df156d7 Mon Sep 17 00:00:00 2001 From: Giannin Date: Thu, 14 Nov 2024 15:33:40 +0100 Subject: [PATCH] Fix MetricCheckInDirective to allow for negative values --- .../checkin/check-in-form-metric/MetricCheckInDirective.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/app/components/checkin/check-in-form-metric/MetricCheckInDirective.ts b/frontend/src/app/components/checkin/check-in-form-metric/MetricCheckInDirective.ts index f25f36e680..f5a99f2a90 100644 --- a/frontend/src/app/components/checkin/check-in-form-metric/MetricCheckInDirective.ts +++ b/frontend/src/app/components/checkin/check-in-form-metric/MetricCheckInDirective.ts @@ -41,6 +41,7 @@ export class MetricCheckInDirective implements ControlValueAccessor { const value: string = param || '0'; if (value.toString().at(0) == '-') { this.onChange(+('-' + value.toString().replace(this.CHAR_REGEX, ''))); + return; } this.onChange(Number(value.toString().replace(this.CHAR_REGEX, ''))); }