1
0
Fork 0
mirror of https://github.com/CaptainCore/Helm.git synced 2025-08-18 03:31:11 +08:00

🐛 FIX: Select first item

This commit is contained in:
Austin Ginder 2025-08-12 09:29:31 -04:00
parent 8722dd7841
commit 31f2beb78d

View file

@ -1181,15 +1181,24 @@
e.__cchNavHandled = true;
e.preventDefault();
setKeyboardMode(true);
if (activeCard) {
// If nothing is active yet, just select the first visible card and stop.
if (!activeCard) {
const first = firstVisibleCard();
if (first) {
setActiveCard(first);
}
} else {
// A card is already active, so decide where to move.
const subs = candidateSubs(activeCard, pop);
// If the card has a submenu and we aren't in it, the next move is to enter it.
if (subs.length && activeSubIndex === -1) {
activeSubIndex = 0;
updateSubHighlight();
return;
} else {
// Otherwise, perform a standard vertical move.
moveVertical(+1);
}
}
moveVertical(+1);
return;
}
}