TreeView Checkbox API not working for checkboxstate set to 0 #183339
Labels
bug
Issue identified by VS Code Team member as probable bug
tree-views
Extension tree view issues
verified
Verification succeeded
Milestone
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
The text was updated successfully, but these errors were encountered: