diff --git a/web/src/features/menu/list/ListItem.tsx b/web/src/features/menu/list/ListItem.tsx index 07d4dc9..32f6a2c 100644 --- a/web/src/features/menu/list/ListItem.tsx +++ b/web/src/features/menu/list/ListItem.tsx @@ -15,6 +15,7 @@ const ListItem = forwardRef, Props>(({ item, index, bg="#25262B" borderRadius="md" tabIndex={index} + scrollMargin={2} p={2} height="60px" key={`item-${index}`} diff --git a/web/src/features/menu/list/index.tsx b/web/src/features/menu/list/index.tsx index 150a022..f3261d8 100644 --- a/web/src/features/menu/list/index.tsx +++ b/web/src/features/menu/list/index.tsx @@ -111,7 +111,11 @@ const ListMenu: React.FC = () => { useEffect(() => { if (!menu.items[selected]) return; - listRefs.current[selected]?.focus(); + listRefs.current[selected]?.scrollIntoView({ + block: "nearest", + inline: "start", + }); + listRefs.current[selected]?.focus({ preventScroll: true }); // debounces the callback to avoid spam const timer = setTimeout(() => { fetchNui(