Update to VS Code 1.52.1
This commit is contained in:
@@ -29,6 +29,7 @@ const SELECT_OPTION_ENTRY_TEMPLATE_ID = 'selectOption.entry.template';
|
||||
interface ISelectListTemplateData {
|
||||
root: HTMLElement;
|
||||
text: HTMLElement;
|
||||
detail: HTMLElement;
|
||||
decoratorRight: HTMLElement;
|
||||
disposables: IDisposable[];
|
||||
}
|
||||
@@ -42,6 +43,7 @@ class SelectListRenderer implements IListRenderer<ISelectOptionItem, ISelectList
|
||||
data.disposables = [];
|
||||
data.root = container;
|
||||
data.text = dom.append(container, $('.option-text'));
|
||||
data.detail = dom.append(container, $('.option-detail'));
|
||||
data.decoratorRight = dom.append(container, $('.option-decorator-right'));
|
||||
|
||||
return data;
|
||||
@@ -49,12 +51,16 @@ class SelectListRenderer implements IListRenderer<ISelectOptionItem, ISelectList
|
||||
|
||||
renderElement(element: ISelectOptionItem, index: number, templateData: ISelectListTemplateData): void {
|
||||
const data: ISelectListTemplateData = templateData;
|
||||
|
||||
const text = element.text;
|
||||
const detail = element.detail;
|
||||
const decoratorRight = element.decoratorRight;
|
||||
|
||||
const isDisabled = element.isDisabled;
|
||||
|
||||
data.text.textContent = text;
|
||||
data.decoratorRight.innerText = (!!decoratorRight ? decoratorRight : '');
|
||||
data.detail.textContent = !!detail ? detail : '';
|
||||
data.decoratorRight.innerText = !!decoratorRight ? decoratorRight : '';
|
||||
|
||||
// pseudo-select disabled option
|
||||
if (isDisabled) {
|
||||
@@ -662,7 +668,10 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
|
||||
let longestLength = 0;
|
||||
|
||||
this.options.forEach((option, index) => {
|
||||
const len = option.text.length + (!!option.decoratorRight ? option.decoratorRight.length : 0);
|
||||
const detailLength = !!option.detail ? option.detail.length : 0;
|
||||
const rightDecoratorLength = !!option.decoratorRight ? option.decoratorRight.length : 0;
|
||||
|
||||
const len = option.text.length + detailLength + rightDecoratorLength;
|
||||
if (len > longestLength) {
|
||||
longest = index;
|
||||
longestLength = len;
|
||||
@@ -697,6 +706,10 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
|
||||
accessibilityProvider: {
|
||||
getAriaLabel: element => {
|
||||
let label = element.text;
|
||||
if (element.detail) {
|
||||
label += `. ${element.detail}`;
|
||||
}
|
||||
|
||||
if (element.decoratorRight) {
|
||||
label += `. ${element.decoratorRight}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user