Avoid selecting the first item automatically in Open Folder Mode

This commit is contained in:
Chia-Hsiang Cheng 2023-08-27 17:25:17 +08:00
parent 6da4ad1662
commit f93f1952cb
1 changed files with 1 additions and 1 deletions

View File

@ -666,7 +666,7 @@ void FileDialog::update_file_list() {
files.pop_front();
}
if (mode != FILE_MODE_SAVE_FILE) {
if (mode != FILE_MODE_SAVE_FILE && mode != FILE_MODE_OPEN_DIR) {
// Select the first file from list if nothing is selected.
if (tree->get_root() && tree->get_root()->get_first_child() && tree->get_selected() == nullptr) {
tree->get_root()->get_first_child()->select(0);