mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Fix error when clicking on empty dropdown (#11637)
This commit is contained in:
@@ -704,8 +704,8 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
|
|||||||
let elementWidth = 0;
|
let elementWidth = 0;
|
||||||
|
|
||||||
if (container) {
|
if (container) {
|
||||||
let longest = 0;
|
let longest = -1;
|
||||||
let longestLength = 0;
|
let longestLength = -1;
|
||||||
|
|
||||||
this.options.forEach((option, index) => {
|
this.options.forEach((option, index) => {
|
||||||
const len = option.text.length + (!!option.decoratorRight ? option.decoratorRight.length : 0);
|
const len = option.text.length + (!!option.decoratorRight ? option.decoratorRight.length : 0);
|
||||||
@@ -715,8 +715,10 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (longest >= 0) {
|
||||||
container.innerHTML = this.options[longest].text + (!!this.options[longest].decoratorRight ? (this.options[longest].decoratorRight + ' ') : '');
|
container.innerHTML = this.options[longest].text + (!!this.options[longest].decoratorRight ? (this.options[longest].decoratorRight + ' ') : '');
|
||||||
|
}
|
||||||
|
|
||||||
elementWidth = dom.getTotalWidth(container);
|
elementWidth = dom.getTotalWidth(container);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user