Description
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
- Clone and run the edited tree-view-sample
- Before selecting or focusing any tree items, click the "Test View: Change Title" button on the view title bar.
Observe that the focusedNode
and selectedNode
arguments are both undefined as expected.
- Select or focus a tree item.
- Click the "Test View: Change Title" button again.
focusedNode
is set as expected
- Press the Escape key, or unfocus the tree with your mouse by clicking outside. The UI shows no focused items.
- 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.
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.