Skip to content

Commit

Permalink
CSCEXAM-1279 Fix click behavior of xm-dropdown-select
Browse files Browse the repository at this point in the history
  • Loading branch information
lupari committed Feb 21, 2024
1 parent f64d496 commit 5a83ee0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ui/src/app/shared/select/dropdown-select.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export interface Option<V, I> {

@Component({
selector: 'xm-dropdown-select',
template: `<div ngbDropdown>
template: `<div ngbDropdown #d="ngbDropdown" autoClose="outside">
<button
ngbDropdownToggle
class="btn btn-outline-secondary"
Expand All @@ -50,7 +50,6 @@ export interface Option<V, I> {
[(ngModel)]="searchFilter"
class="form-control"
(input)="filterOptions()"
(click)="$event.stopPropagation()"
placeholder="{{ 'i18n_search' | translate }}"
/>
<div class="input-group-append">
Expand All @@ -61,11 +60,11 @@ export interface Option<V, I> {
</div>
</button>
}
<button ngbDropdownItem (click)="clearSelection()">
<button ngbDropdownItem (click)="clearSelection(); d.close()">
<i class="bi-x text text-danger"></i>
</button>
@for (opt of filteredOptions; track $index) {
<button ngbDropdownItem [ngClass]="getClasses(opt)" (click)="selectOption(opt)">
<button ngbDropdownItem [ngClass]="getClasses(opt)" (click)="selectOption(opt); d.close()">
@if (!opt.isHeader) {
<span>
{{ opt.label || '' | translate | slice: 0 : 40 }}
Expand Down

0 comments on commit 5a83ee0

Please sign in to comment.