From 2a8e07dd9731cac6ee8cde77dc63dc245521f50d Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Sun, 15 Sep 2024 16:42:48 -0700 Subject: [PATCH] Close on emptied --- .../custom-fields-query-dropdown.component.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.ts b/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.ts index 497a6a8ce..20e231818 100644 --- a/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.ts +++ b/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.ts @@ -1,4 +1,11 @@ -import { Component, EventEmitter, Input, Output } from '@angular/core' +import { + Component, + EventEmitter, + Input, + Output, + ViewChild, +} from '@angular/core' +import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap' import { Subject, first, takeUntil } from 'rxjs' import { CustomField, CustomFieldDataType } from 'src/app/data/custom-field' import { @@ -165,6 +172,8 @@ export class CustomFieldsQueryDropdownComponent { @Input() disabled: boolean = false + @ViewChild('dropdown') dropdown: NgbDropdown + private _selectionModel: CustomFieldQueriesModel @Input() @@ -185,6 +194,7 @@ export class CustomFieldsQueryDropdownComponent { private onModelChange() { if (this.selectionModel.isEmpty() || this.selectionModel.isValid()) { this.selectionModelChange.next(this.selectionModel) + this.selectionModel.isEmpty() && this.dropdown?.close() } }