Skip to content

Commit

Permalink
[GH-#10878] Fix bug of Getting Start Widget Accept Focus
Browse files Browse the repository at this point in the history
Signed-off-by: White Hsu <[email protected]>
  • Loading branch information
WhiteHsu committed Oct 27, 2022
1 parent 7f51450 commit 83fa879
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/getting-started/src/browser/getting-started-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
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 { Message, ReactWidget } from '@theia/core/lib/browser';
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';
Expand Down Expand Up @@ -111,6 +111,14 @@ export class GettingStartedWidget extends ReactWidget {
this.update();
}

protected override onActivateRequest(msg: Message): void {
super.onActivateRequest(msg);
const htmlElement = document.getElementById('getting.started.widget');
if (htmlElement) {
htmlElement?.focus();
}
}

/**
* Render the content of the widget.
*/
Expand Down

0 comments on commit 83fa879

Please sign in to comment.