From 993b7a8bc73b23bc252735c4c356f8ced89958bc Mon Sep 17 00:00:00 2001 From: Duc Nguyen Date: Tue, 15 Sep 2020 16:52:25 -0400 Subject: [PATCH] [scm] Add check to determine which scm-widget is focused + Focus should be on node rather than `commitWidget` when there is no repository in the workspace. Signed-off-by: Duc Nguyen Co-authored-by: Vincent Fugnitto --- packages/scm/src/browser/scm-widget.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/scm/src/browser/scm-widget.tsx b/packages/scm/src/browser/scm-widget.tsx index 6884c9788cac1..06b1aa9cf0d14 100644 --- a/packages/scm/src/browser/scm-widget.tsx +++ b/packages/scm/src/browser/scm-widget.tsx @@ -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 {