X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fheader%2Fsearch-typeahead.component.ts;h=d2549315cd4f9db83cea26c84d9bca20c7844043;hb=4e4c23c5b8d55ab0aa48a7be8c53ec71d1d7e796;hp=e10baea2b967a5a98ba0f5bf84a7b214144dad4b;hpb=9df52d660feb722404be00a50f3c8a612bec1c15;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/header/search-typeahead.component.ts b/client/src/app/header/search-typeahead.component.ts index e10baea2b..d2549315c 100644 --- a/client/src/app/header/search-typeahead.component.ts +++ b/client/src/app/header/search-typeahead.component.ts @@ -4,6 +4,7 @@ import { ListKeyManager } from '@angular/cdk/a11y' import { AfterViewChecked, Component, OnDestroy, OnInit, QueryList, ViewChildren } from '@angular/core' import { ActivatedRoute, Params, Router } from '@angular/router' import { AuthService, ServerService } from '@app/core' +import { logger } from '@root-helpers/logger' import { HTMLServerConfig, SearchTargetType } from '@shared/models' import { SuggestionComponent, SuggestionPayload, SuggestionPayloadType } from './suggestion.component' @@ -91,7 +92,7 @@ export class SearchTypeaheadComponent implements OnInit, AfterViewChecked, OnDes const activeIndex = this.suggestionItems.toArray().findIndex(i => i.result.default === true) if (activeIndex === -1) { - console.error('Cannot find active index.', { suggestionItems: this.suggestionItems }) + logger.error('Cannot find active index.', { suggestionItems: this.suggestionItems }) } this.updateItemsState(activeIndex) @@ -152,7 +153,7 @@ export class SearchTypeaheadComponent implements OnInit, AfterViewChecked, OnDes } } - onSuggestionlicked (payload: SuggestionPayload) { + onSuggestionClicked (payload: SuggestionPayload) { this.doSearch(this.buildSearchTarget(payload)) } @@ -170,6 +171,11 @@ export class SearchTypeaheadComponent implements OnInit, AfterViewChecked, OnDes this.keyboardEventsManager.onKeydown(event) break + + case 'Enter': + event.stopPropagation() + this.doSearch() + break } }