fix(list-box-menu-item): use "nearest" instead of "end" when scrolling into view

This commit is contained in:
Eric Liu 2022-08-31 19:18:52 -07:00
commit 09532cdf2d

View file

@ -14,7 +14,7 @@
$: title = isTruncated ? ref?.innerText : undefined; $: title = isTruncated ? ref?.innerText : undefined;
$: if (highlighted && !ref?.matches(":hover")) { $: if (highlighted && !ref?.matches(":hover")) {
// Scroll highlighted item into view if using keyboard navigation // Scroll highlighted item into view if using keyboard navigation
ref.scrollIntoView({ block: "end" }); ref.scrollIntoView({ block: "nearest" });
} }
</script> </script>