Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
benibenj opened this issue May 24, 2023 · 1 comment
Closed

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

benibenj opened this issue May 24, 2023 · 1 comment
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug tree-views Extension tree view issues verified Verification succeeded
Milestone

Comments

@benibenj
Copy link
Contributor

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

@alexr00 alexr00 added bug Issue identified by VS Code Team member as probable bug tree-views Extension tree view issues labels May 25, 2023
@alexr00 alexr00 added this to the May 2023 milestone May 25, 2023
@alexr00
Copy link
Member

alexr00 commented May 25, 2023

Fixed by #183342

@alexr00 alexr00 closed this as completed May 25, 2023
@andreamah andreamah added the verified Verification succeeded label May 31, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jul 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug tree-views Extension tree view issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants