From 3085fa25f4b94eb4544cc0e5155d0d2ce581e014 Mon Sep 17 00:00:00 2001 From: Remi Schnekenburger Date: Thu, 4 Jul 2024 12:54:33 +0200 Subject: [PATCH] tab selected should be adjacent when closing last one. fixes #13886 contributed on behalf of STMicroelectronics Signed-off-by: Remi Schnekenburger --- packages/core/src/browser/shell/application-shell.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/core/src/browser/shell/application-shell.ts b/packages/core/src/browser/shell/application-shell.ts index cfb5a72f8af68..05b044d9f5cd1 100644 --- a/packages/core/src/browser/shell/application-shell.ts +++ b/packages/core/src/browser/shell/application-shell.ts @@ -1896,6 +1896,10 @@ export class ApplicationShell extends Widget { if (index < current.titles.length - 1) { return index + 1; } + // last item in tab bar. select the previous one. + if (index === current.titles.length - 1) { + return index - 1; + } return 0; }