godotengine / godotengine/godot
File Tree generates errors when selected with keyboard
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
- Reproducible in: v4.4.beta2.official [a013481b0], v4.6.1.rc1.official [7bfffc846], v4.7.dev.custom_build [20d58a38c]
- Not reproducible in: v4.4.beta1.official [d33da79d3]
### System information
Godot v4.6.1.rc1 - Windows 11 (build 26100) - Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 Laptop GPU (NVIDIA; 32.0.15.7260) - 12th Gen Intel(R) Core(TM) i7-12700H (20 threads) - 15.79 GiB memory
### Issue description
If you click on an empty space inside the file tree container, in the filesystem dock, so that there aren't any folders/files selected, take focus away from that container, and then, using the keyboard, return the focus to that container the files/folders will not show any feedback about if they are selected.
You can still do things like moving between files/folders and collapsing/expanding and if you press ui_right it fixes it.
Additionally in this state:
If you press an ui_down (for this step you cannot use ui_up as that way it works normally) and then:
- Press Enter/ui_accept you get:
```
ERROR: No item column selected.
at: (scene\gui\tree.cpp:4453)
```
- Press Space/ui_select you get:
```
ERROR: Index p_column = -1 is out of bounds (cells.size() = 1).
at: TreeItem::is_selected (scene\gui\tree.cpp:1321)
ERROR: Index p_column = -1 is out of bounds (cells.size() = 1).
at: TreeItem::is_selectable (scene\gui\tree.cpp:1316)
```
I wasn't able to bisect or test PR that made changes to Tree because I kept getting errors while compiling but the bug appeared somewhere between 4.4.beta1 and 4.4.beta2
Video example:
https://github.com/user-attachments/assets/0695b6d9-c95e-42c7-93f9-cd45d65a8cf2
### Steps to reproduce
- Open new project
- Click in empty space in the file tree so that there are no file/folders selected
- Take focus away from the tree container, go back to it and press Arrow Down
- Press Enter or Space and check Output
### Minimal reproduction project (MRP)
N/A
Contributor guide
Assessment
This issue has not been assessed yet.