Fix tab focus for select box (#8349)

This commit is contained in:
Charles Gagnon
2019-11-15 14:31:40 -08:00
committed by GitHub
parent 3769b5066f
commit 82185f75d7

View File

@@ -108,12 +108,16 @@ export class SelectBox extends vsSelectBox {
if (e.keyCode === KeyCode.Enter || e.keyCode === KeyCode.Escape) {
dom.EventHelper.stop(e, true);
}
if (e.keyCode === KeyCode.Tab) {
// Set focus back to the input box so that it moves to the next item in the list correctly since
// the context menu isn't in the same place in the DOM so will likely result in an unexpected element
// getting the next focus
this.focus();
}
});
}
}
public style(styles: ISelectBoxStyles): void {
super.style(styles);
this.enabledSelectBackground = this.selectBackground;