mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 15:06:02 +01:00
fix(web/menu): fix button tooltip not displaying on side scroll button
This commit is contained in:
@@ -18,12 +18,9 @@ export const debugMenu = () => {
|
||||
},
|
||||
{
|
||||
label: 'Vehicle class',
|
||||
values: [
|
||||
{ label: 'nice', description: 'description 1' },
|
||||
{ label: 'even nicer', description: 'description 2' },
|
||||
'pogchamp',
|
||||
],
|
||||
values: ['pogchamp', 'nice champ', { label: 'POGGERS', description: 'CHAMPPERS' }],
|
||||
icon: 'tag',
|
||||
description: 'Side scroll general description',
|
||||
},
|
||||
{ label: 'Option 1' },
|
||||
{ label: 'Option 2' },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Box, Stack, Tooltip } from '@chakra-ui/react';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { useNuiEvent } from '../../../hooks/useNuiEvent';
|
||||
import ListItem from './ListItem';
|
||||
import Header from './Header';
|
||||
@@ -27,10 +27,6 @@ export interface MenuSettings {
|
||||
startItemIndex?: number;
|
||||
}
|
||||
|
||||
const isValuesObject = (values?: Array<string | { label: string; description: string }>) => {
|
||||
return Array.isArray(values) && typeof values === 'object';
|
||||
};
|
||||
|
||||
const ListMenu: React.FC = () => {
|
||||
const [menu, setMenu] = useState<MenuSettings>({
|
||||
position: 'top-left',
|
||||
@@ -153,6 +149,13 @@ const ListMenu: React.FC = () => {
|
||||
return () => window.removeEventListener('keydown', keyHandler);
|
||||
}, [visible]);
|
||||
|
||||
const isValuesObject = useCallback(
|
||||
(values?: Array<string | { label: string; description: string }>) => {
|
||||
return Array.isArray(values) && typeof values[indexStates[selected]] === 'object';
|
||||
},
|
||||
[indexStates, selected]
|
||||
);
|
||||
|
||||
useNuiEvent('closeMenu', () => closeMenu(true, undefined, true));
|
||||
|
||||
useNuiEvent('setMenu', (data: MenuSettings) => {
|
||||
|
||||
Reference in New Issue
Block a user