Close on emptied
This commit is contained in:
parent
b0970adaca
commit
2a8e07dd97
@ -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 { Subject, first, takeUntil } from 'rxjs'
|
||||||
import { CustomField, CustomFieldDataType } from 'src/app/data/custom-field'
|
import { CustomField, CustomFieldDataType } from 'src/app/data/custom-field'
|
||||||
import {
|
import {
|
||||||
@ -165,6 +172,8 @@ export class CustomFieldsQueryDropdownComponent {
|
|||||||
@Input()
|
@Input()
|
||||||
disabled: boolean = false
|
disabled: boolean = false
|
||||||
|
|
||||||
|
@ViewChild('dropdown') dropdown: NgbDropdown
|
||||||
|
|
||||||
private _selectionModel: CustomFieldQueriesModel
|
private _selectionModel: CustomFieldQueriesModel
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
@ -185,6 +194,7 @@ export class CustomFieldsQueryDropdownComponent {
|
|||||||
private onModelChange() {
|
private onModelChange() {
|
||||||
if (this.selectionModel.isEmpty() || this.selectionModel.isValid()) {
|
if (this.selectionModel.isEmpty() || this.selectionModel.isValid()) {
|
||||||
this.selectionModelChange.next(this.selectionModel)
|
this.selectionModelChange.next(this.selectionModel)
|
||||||
|
this.selectionModel.isEmpty() && this.dropdown?.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user