fix: Scrolling up action would leave focusIndexes at incorrect states

This commit is contained in:
Aleksi Lassila
2024-06-06 22:27:07 +03:00
parent e039a0c11e
commit 05719d8c04
2 changed files with 98 additions and 2 deletions

View File

@@ -20,14 +20,14 @@
if (selectable && get(selectable.focusIndex) === 0) {
history.back();
} else {
selectable?.focusChild(0) || selectable?.focus();
selectable?.focusChild(0, { cycleTo: true }) || selectable?.focus({ cycleTo: true });
}
}
function handleGoToTop() {
const selectable = get(topSelectable);
if (topSelectable) {
selectable?.focusChild(0) || selectable?.focus();
selectable?.focusChild(0, { cycleTo: true }) || selectable?.focus({ cycleTo: true });
} else handleGoBack();
}
</script>