Merge branch 'release/4.0.0' into develop

pull/4605/head
Chocobozzz 2021-12-03 16:04:56 +01:00
commit d1a233d8d8
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 9 additions and 4 deletions

View File

@ -1,7 +1,7 @@
<div class="d-inline-flex position-relative" id="typeahead-container"> <div class="d-inline-flex position-relative" id="typeahead-container">
<input <input
type="text" id="search-video" name="search-video" #searchVideo i18n-placeholder placeholder="Search videos, playlists, channels…" type="search" id="search-video" name="search-video" #searchVideo i18n-placeholder placeholder="Search videos, playlists, channels…"
[(ngModel)]="search" (ngModelChange)="onSearchChange()" (keydown)="handleKey($event)" (keydown.enter)="doSearch()" [(ngModel)]="search" (ngModelChange)="onSearchChange()" (keydown)="handleKey($event)"
aria-label="Search" autocomplete="off" aria-label="Search" autocomplete="off"
> >
<my-global-icon <my-global-icon
@ -14,7 +14,7 @@
<ul [hidden]="!search || !areSuggestionsOpened" role="listbox" class="p-0 m-0"> <ul [hidden]="!search || !areSuggestionsOpened" role="listbox" class="p-0 m-0">
<li <li
*ngFor="let result of results; let i = index" class="suggestion d-flex flex-justify-start flex-items-center p-0 f5" *ngFor="let result of results; let i = index" class="suggestion d-flex flex-justify-start flex-items-center p-0 f5"
role="option" aria-selected="true" (mouseenter)="onSuggestionHover(i)" (click)="onSuggestionlicked(result)" role="option" aria-selected="true" (mouseenter)="onSuggestionHover(i)" (click)="onSuggestionClicked(result)"
> >
<my-suggestion [result]="result" [highlight]="search"></my-suggestion> <my-suggestion [result]="result" [highlight]="search"></my-suggestion>
</li> </li>

View File

@ -152,7 +152,7 @@ export class SearchTypeaheadComponent implements OnInit, AfterViewChecked, OnDes
} }
} }
onSuggestionlicked (payload: SuggestionPayload) { onSuggestionClicked (payload: SuggestionPayload) {
this.doSearch(this.buildSearchTarget(payload)) this.doSearch(this.buildSearchTarget(payload))
} }
@ -170,6 +170,11 @@ export class SearchTypeaheadComponent implements OnInit, AfterViewChecked, OnDes
this.keyboardEventsManager.onKeydown(event) this.keyboardEventsManager.onKeydown(event)
break break
case 'Enter':
event.stopPropagation()
this.doSearch()
break
} }
} }