diff --git a/packages/getting-started/src/browser/getting-started-contribution.ts b/packages/getting-started/src/browser/getting-started-contribution.ts index cc889b31e0e68..152419d894f7e 100644 --- a/packages/getting-started/src/browser/getting-started-contribution.ts +++ b/packages/getting-started/src/browser/getting-started-contribution.ts @@ -51,14 +51,14 @@ export class GettingStartedContribution extends AbstractViewContribution { if (!this.workspaceService.opened) { this.stateService.reachedState('ready').then( - () => this.openView({ reveal: true }) + () => this.openView({ reveal: true, activate: true }) ); } } override registerCommands(registry: CommandRegistry): void { registry.registerCommand(GettingStartedCommand, { - execute: () => this.openView({ reveal: true }), + execute: () => this.openView({ reveal: true, activate: true }), }); } diff --git a/packages/getting-started/src/browser/getting-started-widget.tsx b/packages/getting-started/src/browser/getting-started-widget.tsx index 5f3b363c30f56..a103e32a89584 100644 --- a/packages/getting-started/src/browser/getting-started-widget.tsx +++ b/packages/getting-started/src/browser/getting-started-widget.tsx @@ -17,11 +17,10 @@ import * as React from '@theia/core/shared/react'; import URI from '@theia/core/lib/common/uri'; import { injectable, inject, postConstruct } from '@theia/core/shared/inversify'; -import { ReactWidget } from '@theia/core/lib/browser/widgets/react-widget'; import { CommandRegistry, isOSX, environment, Path } from '@theia/core/lib/common'; import { WorkspaceCommands, WorkspaceService } from '@theia/workspace/lib/browser'; import { KeymapsCommands } from '@theia/keymaps/lib/browser'; -import { CommonCommands, LabelProvider, Key, KeyCode, codicon } from '@theia/core/lib/browser'; +import { Message, ReactWidget, CommonCommands, LabelProvider, Key, KeyCode, codicon } from '@theia/core/lib/browser'; import { ApplicationInfo, ApplicationServer } from '@theia/core/lib/common/application-protocol'; import { FrontendApplicationConfigProvider } from '@theia/core/lib/browser/frontend-application-config-provider'; import { EnvVariablesServer } from '@theia/core/lib/common/env-variables'; @@ -111,6 +110,14 @@ export class GettingStartedWidget extends ReactWidget { this.update(); } + protected override onActivateRequest(msg: Message): void { + super.onActivateRequest(msg); + const elArr = this.node.getElementsByTagName('a'); + if (elArr && elArr.length > 0) { + (elArr[0] as HTMLElement).focus(); + } + } + /** * Render the content of the widget. */