#4246 UI Searchbox Hint Erneut anzeigen

(cherry picked from commit 9671683a93)
This commit is contained in:
Lorenz Hilpert
2023-08-04 15:56:51 +02:00
parent 08e95cec55
commit 516465db37
3 changed files with 9 additions and 2 deletions

View File

@@ -11,5 +11,6 @@
[hint]="hint$ | async"
(scan)="search($event)"
[scanner]="true"
(hintCleared)="clearHint()"
></ui-searchbox>
</div>

View File

@@ -59,10 +59,12 @@ export class FinishShippingDocumentComponent implements OnInit, OnDestroy {
this._onDestroy$.complete();
}
clearHint() {
this.hint$.next('');
}
search(query: string) {
query = query?.trim();
this.hint$.next('');
if (!query) {
this.hint$.next('Ungültige Eingabe');
return;

View File

@@ -82,6 +82,9 @@ export class UiSearchboxNextComponent extends UiFormControlDirective<any>
@Input()
hint: string = '';
@Output()
hintCleared = new EventEmitter<void>();
@Input()
autocompleteValueSelector: (item: any) => string = (item: any) => item;
@@ -196,6 +199,7 @@ export class UiSearchboxNextComponent extends UiFormControlDirective<any>
clearHint() {
this.hint = '';
this.focused.emit(true);
this.hintCleared.emit();
this.cdr.markForCheck();
}