diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/src/app/header/search-typeahead.component.html | 6 | ||||
-rw-r--r-- | client/src/app/header/search-typeahead.component.ts | 7 |
2 files changed, 9 insertions, 4 deletions
diff --git a/client/src/app/header/search-typeahead.component.html b/client/src/app/header/search-typeahead.component.html index 0ced249a7..9b21d3f86 100644 --- a/client/src/app/header/search-typeahead.component.html +++ b/client/src/app/header/search-typeahead.component.html | |||
@@ -1,7 +1,7 @@ | |||
1 | <div class="d-inline-flex position-relative" id="typeahead-container"> | 1 | <div class="d-inline-flex position-relative" id="typeahead-container"> |
2 | <input | 2 | <input |
3 | type="text" id="search-video" name="search-video" #searchVideo i18n-placeholder placeholder="Search videos, playlists, channels…" | 3 | type="search" id="search-video" name="search-video" #searchVideo i18n-placeholder placeholder="Search videos, playlists, channels…" |
4 | [(ngModel)]="search" (ngModelChange)="onSearchChange()" (keydown)="handleKey($event)" (keydown.enter)="doSearch()" | 4 | [(ngModel)]="search" (ngModelChange)="onSearchChange()" (keydown)="handleKey($event)" |
5 | aria-label="Search" autocomplete="off" | 5 | aria-label="Search" autocomplete="off" |
6 | > | 6 | > |
7 | <my-global-icon | 7 | <my-global-icon |
@@ -14,7 +14,7 @@ | |||
14 | <ul [hidden]="!search || !areSuggestionsOpened" role="listbox" class="p-0 m-0"> | 14 | <ul [hidden]="!search || !areSuggestionsOpened" role="listbox" class="p-0 m-0"> |
15 | <li | 15 | <li |
16 | *ngFor="let result of results; let i = index" class="suggestion d-flex flex-justify-start flex-items-center p-0 f5" | 16 | *ngFor="let result of results; let i = index" class="suggestion d-flex flex-justify-start flex-items-center p-0 f5" |
17 | role="option" aria-selected="true" (mouseenter)="onSuggestionHover(i)" (click)="onSuggestionlicked(result)" | 17 | role="option" aria-selected="true" (mouseenter)="onSuggestionHover(i)" (click)="onSuggestionClicked(result)" |
18 | > | 18 | > |
19 | <my-suggestion [result]="result" [highlight]="search"></my-suggestion> | 19 | <my-suggestion [result]="result" [highlight]="search"></my-suggestion> |
20 | </li> | 20 | </li> |
diff --git a/client/src/app/header/search-typeahead.component.ts b/client/src/app/header/search-typeahead.component.ts index e10baea2b..0794ec8f4 100644 --- a/client/src/app/header/search-typeahead.component.ts +++ b/client/src/app/header/search-typeahead.component.ts | |||
@@ -152,7 +152,7 @@ export class SearchTypeaheadComponent implements OnInit, AfterViewChecked, OnDes | |||
152 | } | 152 | } |
153 | } | 153 | } |
154 | 154 | ||
155 | onSuggestionlicked (payload: SuggestionPayload) { | 155 | onSuggestionClicked (payload: SuggestionPayload) { |
156 | this.doSearch(this.buildSearchTarget(payload)) | 156 | this.doSearch(this.buildSearchTarget(payload)) |
157 | } | 157 | } |
158 | 158 | ||
@@ -170,6 +170,11 @@ export class SearchTypeaheadComponent implements OnInit, AfterViewChecked, OnDes | |||
170 | 170 | ||
171 | this.keyboardEventsManager.onKeydown(event) | 171 | this.keyboardEventsManager.onKeydown(event) |
172 | break | 172 | break |
173 | |||
174 | case 'Enter': | ||
175 | event.stopPropagation() | ||
176 | this.doSearch() | ||
177 | break | ||
173 | } | 178 | } |
174 | } | 179 | } |
175 | 180 | ||