Skip to content

Commit d59d014

Browse files
author
Ubuntu
committed
Fix microsoft#69297 - settings editor dropdown issues
1 parent 8379075 commit d59d014

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

src/vs/base/browser/ui/selectBox/selectBoxCustom.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,7 @@ export class SelectBoxList implements ISelectBoxDelegate, IListVirtualDelegate<I
419419
// ContextView dropdown methods
420420

421421
private showSelectDropDown() {
422+
this.selectionDetailsPane.innerText = '';
422423

423424
if (!this.contextViewProvider || this._isVisible) {
424425
return;
@@ -568,7 +569,8 @@ export class SelectBoxList implements ISelectBoxDelegate, IListVirtualDelegate<I
568569

569570
this.selectDropDownContainer.style.width = selectOptimalWidth;
570571

571-
// Get initial list height and determine space ab1you knowove and below
572+
// Get initial list height and determine space above and below
573+
this.selectList.getHTMLElement().style.height = '';
572574
this.selectList.layout();
573575
let listHeight = this.selectList.contentHeight;
574576

@@ -667,6 +669,7 @@ export class SelectBoxList implements ISelectBoxDelegate, IListVirtualDelegate<I
667669
if (this._hasDetails) {
668670
// Leave the selectDropDownContainer to size itself according to children (list + details) - #57447
669671
this.selectList.getHTMLElement().style.height = (listHeight + verticalPadding) + 'px';
672+
this.selectDropDownContainer.style.height = '';
670673
} else {
671674
this.selectDropDownContainer.style.height = (listHeight + verticalPadding) + 'px';
672675
}

src/vs/workbench/contrib/preferences/electron-browser/settingsEditor2.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,12 @@ export class SettingsEditor2 extends BaseEditor {
940940
return Promise.resolve(undefined);
941941
}
942942

943+
// If the context view is focused, delay rendering settings
944+
if (this.contextViewFocused()) {
945+
this.scheduleRefresh(document.querySelector('.context-view'), key);
946+
return Promise.resolve(undefined);
947+
}
948+
943949
// If a setting control is currently focused, schedule a refresh for later
944950
const activeElement = this.getActiveElementInSettingsTree();
945951
const focusedSetting = activeElement && this.settingRenderers.getSettingDOMElementForDOMElement(activeElement);
@@ -980,6 +986,10 @@ export class SettingsEditor2 extends BaseEditor {
980986
return Promise.resolve(undefined);
981987
}
982988

989+
private contextViewFocused(): boolean {
990+
return !!DOM.findParentWithClass(<HTMLElement>document.activeElement, 'context-view');
991+
}
992+
983993
private refreshTree(): void {
984994
if (this.isVisible()) {
985995
this.settingsTree.setChildren(null, createGroupIterator(this.currentSettingsModel.root));

0 commit comments

Comments
 (0)