mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-849] improve search component (#5245)
This commit is contained in:
committed by
Eugenio Romano
parent
c0c7f0cc1c
commit
adbee04c2c
@@ -65,6 +65,9 @@ export class SearchTextInputComponent implements OnInit, OnDestroy {
|
||||
@Input()
|
||||
focusListener: Observable<FocusEvent>;
|
||||
|
||||
@Input()
|
||||
collapseOnSubmit: boolean = true;
|
||||
|
||||
@Input()
|
||||
defaultState: SearchTextStateEnum = SearchTextStateEnum.collapsed;
|
||||
|
||||
@@ -147,7 +150,7 @@ export class SearchTextInputComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
applySearchFocus(animationDoneEvent) {
|
||||
if (animationDoneEvent.toState === 'active') {
|
||||
if (animationDoneEvent.toState === 'active' && this.defaultState !== SearchTextStateEnum.expanded) {
|
||||
this.searchInput.nativeElement.focus();
|
||||
}
|
||||
}
|
||||
@@ -238,7 +241,9 @@ export class SearchTextInputComponent implements OnInit, OnDestroy {
|
||||
|
||||
searchSubmit(event: any) {
|
||||
this.submit.emit(event);
|
||||
this.toggleSearchBar();
|
||||
if (this.collapseOnSubmit) {
|
||||
this.toggleSearchBar();
|
||||
}
|
||||
}
|
||||
|
||||
activateToolbar(): boolean {
|
||||
|
Reference in New Issue
Block a user