Skip to content

TreeView Checkbox API not working for checkboxstate set to 0 #183339

@benibenj

Description

@benibenj

As @Eskibear mentioned in #116141 (comment) the checkboxstate of TreeItem2 does not work correctly when set to the value 0. It parses it incorrectly and sets it to "No checkbox" instead of "unchecked checkbox". When it's set to the value 1 it creates the checkbox and checks it.

However, when the checkbox is set in the following way, the checkbox works like intended:
checkboxState: { state: condition ? 1 : 0}

I had a quick look at the code and I believe the problem lies here: https://github.com/microsoft/vscode/blob/main/src/vs/workbench/api/common/extHostTreeViews.ts#L767

It seems like it should be checking for undefined as the value 0 will also trigger it to return undefined otherwise

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugtree-viewsExtension tree view issuesverifiedVerification succeeded

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions