Skip to content

Commit 7eec26f

Browse files
authored
Fix checkbox state management in tree view (microsoft#196721)
`manageCheckboxStateManually` has no effect on tree view Fixes microsoft#196607
1 parent 10a184f commit 7eec26f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/vs/workbench/browser/parts/views/treeView.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ abstract class AbstractTreeView extends Disposable implements ITreeView {
643643
const dataSource = this.instantiationService.createInstance(TreeDataSource, this, <T>(task: Promise<T>) => this.progressService.withProgress({ location: this.id }, () => task));
644644
const aligner = new Aligner(this.themeService);
645645
const checkboxStateHandler = this._register(new CheckboxStateHandler());
646-
const renderer = this.instantiationService.createInstance(TreeRenderer, this.id, treeMenus, this.treeLabels, actionViewItemProvider, aligner, checkboxStateHandler, this.manuallyManageCheckboxes);
646+
const renderer = this.instantiationService.createInstance(TreeRenderer, this.id, treeMenus, this.treeLabels, actionViewItemProvider, aligner, checkboxStateHandler, () => this.manuallyManageCheckboxes);
647647
this._register(renderer.onDidChangeCheckboxState(e => this._onDidChangeCheckboxState.fire(e)));
648648

649649
const widgetAriaLabel = this._title;
@@ -1102,7 +1102,7 @@ class TreeRenderer extends Disposable implements ITreeRenderer<ITreeItem, FuzzyS
11021102
private actionViewItemProvider: IActionViewItemProvider,
11031103
private aligner: Aligner,
11041104
private checkboxStateHandler: CheckboxStateHandler,
1105-
private readonly manuallyManageCheckboxes: boolean,
1105+
private readonly manuallyManageCheckboxes: () => boolean,
11061106
@IThemeService private readonly themeService: IThemeService,
11071107
@IConfigurationService private readonly configurationService: IConfigurationService,
11081108
@ILabelService private readonly labelService: ILabelService,
@@ -1351,7 +1351,7 @@ class TreeRenderer extends Disposable implements ITreeRenderer<ITreeItem, FuzzyS
13511351
private updateCheckboxes(items: ITreeItem[]) {
13521352
const additionalItems: ITreeItem[] = [];
13531353

1354-
if (!this.manuallyManageCheckboxes) {
1354+
if (!this.manuallyManageCheckboxes()) {
13551355
for (const item of items) {
13561356
if (item.checkbox !== undefined) {
13571357

0 commit comments

Comments
 (0)