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'
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)
}
}
- onSuggestionlicked (payload: SuggestionPayload) {
+ onSuggestionClicked (payload: SuggestionPayload) {
this.doSearch(this.buildSearchTarget(payload))
}
this.keyboardEventsManager.onKeydown(event)
break
+
+ case 'Enter':
+ event.stopPropagation()
+ this.doSearch()
+ break
}
}