fix(list-box-menu-item): do not scroll entire page when using keyboard navigation (#1474)

This commit is contained in:
metonym 2022-08-31 19:25:51 -07:00 committed by GitHub
commit edf33ca2d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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>