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

Focused item in tree is never unfocused #171550

Open
alexweininger opened this issue Jan 17, 2023 · 0 comments
Open

Focused item in tree is never unfocused #171550

alexweininger opened this issue Jan 17, 2023 · 0 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug tree-views Extension tree view issues
Milestone

Comments

@alexweininger
Copy link
Member

Does this issue occur when all extensions are disabled?: No - issue with trees contributed by any extension

  • VS Code Version: 1.75.0-insider
  • OS Version: Darwin x64 22.2.0
VS Code details

Version: 1.75.0-insider
Commit: 1379f03
Date: 2023-01-17T05:21:02.509Z
Electron: 19.1.9
Chromium: 102.0.5005.194
Node.js: 16.14.2
V8: 10.2.154.23-electron.0
OS: Darwin x64 22.2.0
Sandboxed: Yes

Steps to Reproduce:

I edited the tree-view-sample extension to provide a minimal reproducible example https://github.com/alexweininger/vscode-extension-samples/tree/alex/focus-never-unset/tree-view-sample

  1. Clone and run the edited tree-view-sample
  2. Before selecting or focusing any tree items, click the "Test View: Change Title" button on the view title bar.

image

Observe that the focusedNode and selectedNode arguments are both undefined as expected.
image

image

  1. Select or focus a tree item.
  2. Click the "Test View: Change Title" button again.

focusedNode is set as expected
image

  1. Press the Escape key, or unfocus the tree with your mouse by clicking outside. The UI shows no focused items.

image

  1. Without selecting or focusing tree items, click the "Trest View: Change Title" button.

Expect: focusedNode argument should be undefined.

Actual: focusedNode is set to the last node that had focus in the tree.

image

It seems that the focused item is unable to be "reset", and only able to change to a different item. I don't think this is intended behavior, since the UI doesn't display any item as being focused. This creates confusion as commands may act differently depending on if focusedNode is defined.

@alexr00 alexr00 added bug Issue identified by VS Code Team member as probable bug tree-views Extension tree view issues labels Jan 18, 2023
@alexr00 alexr00 modified the milestones: Backlog, On Deck Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug tree-views Extension tree view issues
Projects
None yet
Development

No branches or pull requests

2 participants