From 8aedb8f022efceb01025c7dc4745517b6c9a7f0b Mon Sep 17 00:00:00 2001 From: Shivangi917 Date: Fri, 25 Jul 2025 03:44:18 -0400 Subject: [PATCH] [ACS-9374] Show validation error on checking and unchecking checkbox --- .../search-input-control/search-input-control.component.ts | 4 ++-- .../components/search/search-input/search-input.component.ts | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/projects/aca-content/src/lib/components/search/search-input-control/search-input-control.component.ts b/projects/aca-content/src/lib/components/search/search-input-control/search-input-control.component.ts index 5aa4980a9..cea825fba 100644 --- a/projects/aca-content/src/lib/components/search/search-input-control/search-input-control.component.ts +++ b/projects/aca-content/src/lib/components/search/search-input-control/search-input-control.component.ts @@ -118,7 +118,7 @@ export class SearchInputControlComponent implements OnInit, OnChanges { } ngOnChanges(changes: SimpleChanges): void { - if (changes['hasLibrariesConstraint'] && !changes['hasLibrariesConstraint'].firstChange && this.searchFieldFormControl.touched) { + if (changes['hasLibrariesConstraint'] && !changes['hasLibrariesConstraint'].firstChange) { this.emitValidationError(); } } @@ -149,7 +149,7 @@ export class SearchInputControlComponent implements OnInit, OnChanges { return this.searchTerm.trim()?.length < 2; } - private emitValidationError(): void { + emitValidationError(): void { const errors = this.searchFieldFormControl.errors; if (errors?.whitespace) { this.validationError.emit('SEARCH.INPUT.WHITESPACE'); diff --git a/projects/aca-content/src/lib/components/search/search-input/search-input.component.ts b/projects/aca-content/src/lib/components/search/search-input/search-input.component.ts index 87c37f281..2e2eb7bb2 100644 --- a/projects/aca-content/src/lib/components/search/search-input/search-input.component.ts +++ b/projects/aca-content/src/lib/components/search/search-input/search-input.component.ts @@ -211,6 +211,8 @@ export class SearchInputComponent implements OnInit, OnDestroy { this.syncInputValues(); this.has400LibraryError = false; + this.searchInputControl.emitValidationError(); + if (!this.searchedWord.trim()) { return; }