Skip to content

Commit 206ec7d

Browse files
committed
Volume picker: Wrap cursor at top/bottom
1 parent 0372ce2 commit 206ec7d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

apps/desktop/src/lib/file-explorer/navigation/VolumeBreadcrumb.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,11 @@
242242
function handleDropdownKey(key: string): boolean {
243243
switch (key) {
244244
case 'ArrowDown':
245-
highlightedIndex = Math.min(highlightedIndex + 1, allVolumes.length - 1)
245+
highlightedIndex = (highlightedIndex + 1) % allVolumes.length
246246
enterKeyboardMode()
247247
return true
248248
case 'ArrowUp':
249-
highlightedIndex = Math.max(highlightedIndex - 1, 0)
249+
highlightedIndex = (highlightedIndex - 1 + allVolumes.length) % allVolumes.length
250250
enterKeyboardMode()
251251
return true
252252
case 'ArrowRight':

0 commit comments

Comments
 (0)