Skip to content

Commit

Permalink
fix(platform:search-input): Closing category dropdown after category …
Browse files Browse the repository at this point in the history
…item is selected (#1640)
  • Loading branch information
KevinOkamoto authored and fkolar committed Dec 4, 2019
1 parent 7b9ce5c commit 7317382
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions libs/core/src/lib/popover/public_api.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './popover.module';
export * from './popover.component';
export * from './popover-directive/popover.directive';
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
(ngModelChange)="onValueChange($event)" (itemClicked)="onItemClick($event)" [searchFunction]="onSearchSubmit"
[disabled]="disabled">
</fd-combobox>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, OnInit, Input, EventEmitter, Output, OnChanges, SimpleChanges, ViewChild, AfterViewInit, ChangeDetectionStrategy } from '@angular/core';
import { ComboboxComponent, ComboboxItem } from '@fundamental-ngx/core';
import { ComboboxComponent, ComboboxItem, PopoverComponent } from '@fundamental-ngx/core';
import { Observable, isObservable, of } from 'rxjs';
import { map } from 'rxjs/operators';

Expand Down Expand Up @@ -114,6 +114,8 @@ export class SearchInputComponent implements OnInit, OnChanges, AfterViewInit {

@ViewChild('combobox', { static: false }) combobox: ComboboxComponent;

@ViewChild('categoryDropdown', { static: false }) categoryDropdown: PopoverComponent;

constructor() { }

ngOnInit() { }
Expand Down Expand Up @@ -207,6 +209,7 @@ export class SearchInputComponent implements OnInit, OnChanges, AfterViewInit {
*/
setCurrentCategory(category: ValueLabelItem) {
this.currentCategory = category;
this.categoryDropdown.close();
this.inputChange.emit({
text: this.inputText,
category: (this.currentCategory && this.currentCategory.value) ? this.currentCategory.value : null
Expand Down

0 comments on commit 7317382

Please sign in to comment.