提交 81521ba3 编写于 作者: C Christof Marti

Prevent checkbox toggle (fixes #91740)

上级 c456674f
......@@ -106,6 +106,11 @@ class ListElementRenderer implements IListRenderer<ListElement, IListElementTemp
// Checkbox
const label = dom.append(data.entry, $('label.quick-input-list-label'));
data.toDisposeTemplate.push(dom.addStandardDisposableListener(label, dom.EventType.CLICK, e => {
if (!data.checkbox.offsetParent) { // If checkbox not visible:
e.preventDefault(); // Prevent toggle of checkbox when it is immediately shown afterwards. #91740
}
}));
data.checkbox = <HTMLInputElement>dom.append(label, $('input.quick-input-list-checkbox'));
data.checkbox.type = 'checkbox';
data.toDisposeTemplate.push(dom.addStandardDisposableListener(data.checkbox, dom.EventType.CHANGE, e => {
......
......@@ -52,7 +52,6 @@ import { fromNow } from 'vs/base/common/date';
import { IProductService } from 'vs/platform/product/common/productService';
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
import { IOpenerService } from 'vs/platform/opener/common/opener';
import { timeout } from 'vs/base/common/async';
import { distinct } from 'vs/base/common/arrays';
const enum AuthStatus {
......@@ -1074,8 +1073,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
quickPick.items = items;
disposables.add(quickPick.onDidAccept(() => {
if (quickPick.selectedItems[0] && quickPick.selectedItems[0].id) {
// Introduce timeout as workaround - #91661 #91740
timeout(0).then(() => commandService.executeCommand(quickPick.selectedItems[0].id!));
commandService.executeCommand(quickPick.selectedItems[0].id);
}
quickPick.hide();
}));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册