Skip to content

Commit 5a7b292

Browse files
committed
change selection to always first
1 parent 6a5f758 commit 5a7b292

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/main/kotlin/org/polyfrost/intelliprocessor/utils/SourceSetFileDialog.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,10 @@ class SourceSetFileDialog(
9494
it.toString().lowercase().contains(filter)
9595
})
9696

97-
// Improve keyboard navigation by auto-selecting the only remaining result
98-
if (listModel.size == 1) {
97+
if (filter.isEmpty() || listModel.isEmpty) {
98+
list.setSelectedValue(null, false)
99+
} else {
100+
// Improve keyboard navigation by auto-selecting the first result
99101
list.setSelectedValue(listModel.getElementAt(0), false)
100102
}
101103
}

0 commit comments

Comments
 (0)