mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 15:36:02 +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"
|
bg="#25262B"
|
||||||
borderRadius="md"
|
borderRadius="md"
|
||||||
tabIndex={index}
|
tabIndex={index}
|
||||||
|
scrollMargin={2}
|
||||||
p={2}
|
p={2}
|
||||||
height="60px"
|
height="60px"
|
||||||
key={`item-${index}`}
|
key={`item-${index}`}
|
||||||
|
|||||||
@@ -111,7 +111,11 @@ const ListMenu: React.FC = () => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!menu.items[selected]) return;
|
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
|
// debounces the callback to avoid spam
|
||||||
const timer = setTimeout(() => {
|
const timer = setTimeout(() => {
|
||||||
fetchNui(
|
fetchNui(
|
||||||
|
|||||||
Reference in New Issue
Block a user