From 235edd247cbe5c980b2b2810fa3659de09bd8011 Mon Sep 17 00:00:00 2001 From: Igor Propisnov Date: Thu, 22 Aug 2024 13:29:23 +0200 Subject: [PATCH] validate field on touch --- .../src/app/shared/components/dropdown/dropdown.component.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/shared/components/dropdown/dropdown.component.ts b/frontend/src/app/shared/components/dropdown/dropdown.component.ts index c766f77..2609bde 100644 --- a/frontend/src/app/shared/components/dropdown/dropdown.component.ts +++ b/frontend/src/app/shared/components/dropdown/dropdown.component.ts @@ -208,12 +208,13 @@ export class DropdownComponent implements ControlValueAccessor, Validator { public onFocus(): void { this.filteredItems.set(this.items()); + this.markAsTouched(); } public onBlur(): void { - if (!this.isMouseInDropdown) { + if (!this.isMouseInDropdown()) { this.closeDropdown(); - this.onTouched(); + this.markAsTouched(); } }