diff --git a/src/app/components/floating-column/search/search.component.html b/src/app/components/floating-column/search/search.component.html index c085df15..f182072c 100644 --- a/src/app/components/floating-column/search/search.component.html +++ b/src/app/components/floating-column/search/search.component.html @@ -4,7 +4,7 @@

search

-
diff --git a/src/app/components/floating-column/search/search.component.ts b/src/app/components/floating-column/search/search.component.ts index 4f0fc492..52b97578 100644 --- a/src/app/components/floating-column/search/search.component.ts +++ b/src/app/components/floating-column/search/search.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; +import { Component, OnInit, Input, Output, EventEmitter, ViewChild, ElementRef } from '@angular/core'; import { HttpErrorResponse } from '@angular/common/http'; import { MastodonWrapperService } from '../../../services/mastodon-wrapper.service'; @@ -26,12 +26,15 @@ export class SearchComponent implements OnInit { @Output() browseHashtagEvent = new EventEmitter(); @Output() browseThreadEvent = new EventEmitter(); + @ViewChild('search') searchElement: ElementRef; + constructor( private readonly notificationService: NotificationService, private readonly toolsService: ToolsService, private readonly mastodonService: MastodonWrapperService) { } ngOnInit() { + this.searchElement.nativeElement.focus(); } onSubmit(): boolean {