From 7db391d762514c3ed55fba67ba17f2b82729af7b Mon Sep 17 00:00:00 2001 From: nymkappa <1612910616@pm.me> Date: Mon, 24 Jul 2023 11:51:15 +0900 Subject: [PATCH] [search bar] add missing autofocus on lightning dashboard --- .../lightning-dashboard/lightning-dashboard.component.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/lightning/lightning-dashboard/lightning-dashboard.component.ts b/frontend/src/app/lightning/lightning-dashboard/lightning-dashboard.component.ts index 6fa4b454c..adaa8d115 100644 --- a/frontend/src/app/lightning/lightning-dashboard/lightning-dashboard.component.ts +++ b/frontend/src/app/lightning/lightning-dashboard/lightning-dashboard.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; +import { AfterViewChecked, ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; import { Observable } from 'rxjs'; import { share } from 'rxjs/operators'; import { INodesRanking } from '../../interfaces/node-api.interface'; @@ -12,7 +12,7 @@ import { LightningApiService } from '../lightning-api.service'; styleUrls: ['./lightning-dashboard.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, }) -export class LightningDashboardComponent implements OnInit { +export class LightningDashboardComponent implements OnInit, AfterViewChecked { statistics$: Observable; nodesRanking$: Observable; officialMempoolSpace = this.stateService.env.OFFICIAL_MEMPOOL_SPACE; @@ -30,4 +30,7 @@ export class LightningDashboardComponent implements OnInit { this.statistics$ = this.lightningApiService.getLatestStatistics$().pipe(share()); } + ngAfterViewChecked(): void { + this.stateService.focusSearchInputDesktop(); + } }