Skip to content

Commit

Permalink
fixes #219199
Browse files Browse the repository at this point in the history
  • Loading branch information
meganrogge committed Jul 30, 2024
1 parent 9014109 commit 703fd82
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/vs/base/browser/ui/actionbar/actionbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -465,13 +465,13 @@ export class ActionBar extends Disposable implements IActionRunner {
const firstEnabled = this.viewItems.findIndex(item => item.isEnabled());
// Focus the first enabled item
this.focusedItem = firstEnabled === -1 ? undefined : firstEnabled;
this.updateFocus(undefined, undefined, true);
this.updateFocus();
} else {
if (index !== undefined) {
this.focusedItem = index;
}

this.updateFocus(undefined, undefined, true);
this.updateFocus();
}
}

Expand Down Expand Up @@ -537,7 +537,7 @@ export class ActionBar extends Disposable implements IActionRunner {
return true;
}

protected updateFocus(fromRight?: boolean, preventScroll?: boolean, forceFocus: boolean = false): void {
protected updateFocus(fromRight?: boolean, preventScroll?: boolean): void {
if (typeof this.focusedItem === 'undefined') {
this.actionsList.focus({ preventScroll });
}
Expand All @@ -563,10 +563,10 @@ export class ActionBar extends Disposable implements IActionRunner {
if (!focusItem) {
this.actionsList.focus({ preventScroll });
this.previouslyFocusedItem = undefined;
} else if (forceFocus || this.previouslyFocusedItem !== this.focusedItem) {
actionViewItem.focus(fromRight);
this.previouslyFocusedItem = this.focusedItem;
return;
}
actionViewItem.focus(fromRight);
this.previouslyFocusedItem = this.focusedItem;
if (focusItem) {
actionViewItem.showHover?.();
}
Expand Down

0 comments on commit 703fd82

Please sign in to comment.