From 3ec3c4e7a7f2fed6e9dfac6346087b0c705e6674 Mon Sep 17 00:00:00 2001 From: gkbishnoi07 Date: Tue, 11 Aug 2026 18:36:45 +0000 Subject: [PATCH 1/3] fix(input): sync reactive model when the numeric guard reverts a character The allowText/StringValidator guard reverts a rejected character in the DOM (event.target.value = lastVal) but never updated the reactive FormControl, so the value accessor could keep the rejected char in the saved payload while the visible box looked clean. Re-emit 'input' after a revert so the corrected value is written back into the model; guarded against re-entrancy so the (now valid) re-emitted event cannot recurse. Fixes MMU bugfest [15] for Duration and other numeric fields. --- .../core/directives/stringValidator.directive.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/app/app-modules/core/directives/stringValidator.directive.ts b/src/app/app-modules/core/directives/stringValidator.directive.ts index aa5bb60d..31f25fe6 100644 --- a/src/app/app-modules/core/directives/stringValidator.directive.ts +++ b/src/app/app-modules/core/directives/stringValidator.directive.ts @@ -52,6 +52,7 @@ export class StringValidatorDirective { lastValue = null; result: boolean = false; + private syncing = false; constructor(private elementRef: ElementRef) {} @@ -145,6 +146,19 @@ export class StringValidatorDirective { } else { this.validateEntry(val, lastVal, maxlength, event); } + + // If a guard above reverted/overrode the visible value, the reactive form + // model was already updated with the raw (rejected) value by the value + // accessor on this same 'input' event — so the box looks clean but the saved + // FormControl keeps the rejected character. Re-emit 'input' so the corrected + // DOM value is written back into the model. Guarded so the re-emitted event + // (which is now valid and won't revert) cannot recurse. + if (!this.syncing && event.target.value !== val) { + this.syncing = true; + event.target.dispatchEvent(new Event('input', { bubbles: true })); + this.syncing = false; + } + this.lastValue = event.target.value; } validateEntry(val: any, lastVal: any, maxlength: any, event: any) { From 03169414e52e9763b1bbffb9c910696d739359a5 Mon Sep 17 00:00:00 2001 From: gkbishnoi07 Date: Wed, 19 Aug 2026 04:50:40 +0000 Subject: [PATCH 2/3] chore(input): remove explanatory comment per review --- Common-UI | 2 +- .../core/directives/stringValidator.directive.ts | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/Common-UI b/Common-UI index 209356cf..96503ea0 160000 --- a/Common-UI +++ b/Common-UI @@ -1 +1 @@ -Subproject commit 209356cf324fb19ca5705e62c58931062468147f +Subproject commit 96503ea0089896bf6908c4302ba0c67252230958 diff --git a/src/app/app-modules/core/directives/stringValidator.directive.ts b/src/app/app-modules/core/directives/stringValidator.directive.ts index 31f25fe6..e9e00800 100644 --- a/src/app/app-modules/core/directives/stringValidator.directive.ts +++ b/src/app/app-modules/core/directives/stringValidator.directive.ts @@ -147,12 +147,6 @@ export class StringValidatorDirective { this.validateEntry(val, lastVal, maxlength, event); } - // If a guard above reverted/overrode the visible value, the reactive form - // model was already updated with the raw (rejected) value by the value - // accessor on this same 'input' event — so the box looks clean but the saved - // FormControl keeps the rejected character. Re-emit 'input' so the corrected - // DOM value is written back into the model. Guarded so the re-emitted event - // (which is now valid and won't revert) cannot recurse. if (!this.syncing && event.target.value !== val) { this.syncing = true; event.target.dispatchEvent(new Event('input', { bubbles: true })); From 91ded3e5c3fd0a2e9a570e4a9a05035cbe5e07c4 Mon Sep 17 00:00:00 2001 From: gkbishnoi07 Date: Wed, 19 Aug 2026 16:21:55 +0000 Subject: [PATCH 3/3] chore: bump Common-UI to include #82 (registration mandatory fields) --- Common-UI | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common-UI b/Common-UI index 96503ea0..a5b78ec4 160000 --- a/Common-UI +++ b/Common-UI @@ -1 +1 @@ -Subproject commit 96503ea0089896bf6908c4302ba0c67252230958 +Subproject commit a5b78ec4b7ce8bfc369a88d23ccecce9c345e0e1