Skip to content

Commit

Permalink
[scm] Add check to determine which scm-widget is focused
Browse files Browse the repository at this point in the history
+ Focus should be on node rather than `commitWidget` when there is no
repository in the workspace.

Signed-off-by: Duc Nguyen <[email protected]>
Co-authored-by: Vincent Fugnitto <[email protected]>
  • Loading branch information
DucNgn and vince-fugnitto committed Sep 16, 2020
1 parent 64670d7 commit 993b7a8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/scm/src/browser/scm-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,11 @@ export class ScmWidget extends BaseWidget implements StatefulWidget {
protected onActivateRequest(msg: Message): void {
super.onActivateRequest(msg);
this.refresh();
this.commitWidget.focus();
if (this.commitWidget.isVisible) {
this.commitWidget.focus();
} else {
this.node.focus();
}
}

protected focusInput(): void {
Expand Down

0 comments on commit 993b7a8

Please sign in to comment.