提交 c975752a 编写于 作者: S SteVen Batten

fixes #77430

上级 57f3bc13
...@@ -99,6 +99,14 @@ export class Dialog extends Disposable { ...@@ -99,6 +99,14 @@ export class Dialog extends Disposable {
let focusedButton = 0; let focusedButton = 0;
const buttonGroup = this.buttonGroup = new ButtonGroup(this.buttonsContainer, this.buttons.length, { title: true }); const buttonGroup = this.buttonGroup = new ButtonGroup(this.buttonsContainer, this.buttons.length, { title: true });
const buttonMap = this.rearrangeButtons(this.buttons, this.options.cancelId); const buttonMap = this.rearrangeButtons(this.buttons, this.options.cancelId);
// Set focused button to UI index
buttonMap.forEach((value, index) => {
if (value.index === 0) {
focusedButton = index;
}
});
buttonGroup.buttons.forEach((button, index) => { buttonGroup.buttons.forEach((button, index) => {
button.label = mnemonicButtonLabel(buttonMap[index].label, true); button.label = mnemonicButtonLabel(buttonMap[index].label, true);
...@@ -190,11 +198,7 @@ export class Dialog extends Disposable { ...@@ -190,11 +198,7 @@ export class Dialog extends Disposable {
show(this.element); show(this.element);
// Focus first element // Focus first element
buttonMap.forEach((value, index) => { buttonGroup.buttons[focusedButton].focus();
if (value.index === focusedButton) {
buttonGroup.buttons[index].focus();
}
});
}); });
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册