mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 06:56:03 +01:00
fix(web/menu): fix scrolling clipping menu items
This commit is contained in:
@@ -15,6 +15,7 @@ const ListItem = forwardRef<Array<HTMLDivElement | null>, Props>(({ item, index,
|
||||
bg="#25262B"
|
||||
borderRadius="md"
|
||||
tabIndex={index}
|
||||
scrollMargin={2}
|
||||
p={2}
|
||||
height="60px"
|
||||
key={`item-${index}`}
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user