Skip to content

Commit

Permalink
tab selected should be adjacent when closing last one. (#13912)
Browse files Browse the repository at this point in the history
fixes #13886

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>
  • Loading branch information
rschnekenbu committed Jul 18, 2024
1 parent 9e307dd commit a4bf86f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<!-- ## not yet released
- [core] introduce `FRONTEND_CONNECTION_TIMEOUT` environment variable to override application connexion settings. [#13936](https://github.com/eclipse-theia/theia/pull/13936) - Contributed on behalf of STMicroelectronics
- [core] tab selected should be adjacent when closing last one [#13912](https://github.com/eclipse-theia/theia/pull/13912) - contributed on behalf of STMicroelectronics
<a name="breaking_changes_not_yet_released">[Breaking Changes:](#breaking_changes_not_yet_released)</a>
Expand Down
4 changes: 4 additions & 0 deletions packages/core/src/browser/shell/application-shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit a4bf86f

Please sign in to comment.