mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-04-11 14:19:38 +00:00
Focus search on start
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<!-- Search Input -->
|
||||
<div class="flex items-center flex-1 flex-grow-[2] min-w-[21rem]">
|
||||
<div class="form-control w-full">
|
||||
<input type="text" [formControl]="searchControl" placeholder="Search..." class="input input-bordered pr-14" />
|
||||
<input #searchInput type="text" [formControl]="searchControl" placeholder="Search..." class="input input-bordered pr-14" />
|
||||
</div>
|
||||
@if (searchLoading) {
|
||||
<span class="loading loading-spinner loading-sm self-center -ml-9"></span>
|
||||
|
||||
@@ -13,6 +13,8 @@ import { difficulties, difficultyDisplay, instrumentDisplay, instruments } from
|
||||
})
|
||||
export class SearchBarComponent implements OnInit, AfterViewInit {
|
||||
|
||||
@ViewChild('searchInput') searchInput: ElementRef<HTMLInputElement>
|
||||
|
||||
@ViewChild('hasSoloSections') hasSoloSections: ElementRef<HTMLInputElement>
|
||||
@ViewChild('hasForcedNotes') hasForcedNotes: ElementRef<HTMLInputElement>
|
||||
@ViewChild('hasOpenNotes') hasOpenNotes: ElementRef<HTMLInputElement>
|
||||
@@ -45,6 +47,7 @@ export class SearchBarComponent implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
this.searchInput.nativeElement.focus()
|
||||
this.updateDisabledControls()
|
||||
this.searchService.instrument.valueChanges.subscribe(() => {
|
||||
this.updateDisabledControls()
|
||||
|
||||
Reference in New Issue
Block a user