mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 06:56:03 +01:00
fix(web/menu): move firstRengerRef check earlier in the function (#145)
* This fixes a case where, if the first option selected in a menu doesn't have side scroll values, the first time that you *did* side scroll on an item in that menu it would no trigger onSideScroll
This commit is contained in:
@@ -87,11 +87,11 @@ const ListMenu: React.FC = () => {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (!menu.items[selected]?.values) return;
|
||||
if (firstRenderRef.current) {
|
||||
firstRenderRef.current = false;
|
||||
return;
|
||||
}
|
||||
if (!menu.items[selected]?.values) return;
|
||||
const timer = setTimeout(() => {
|
||||
fetchNui('changeIndex', [selected, indexStates[selected]]).catch();
|
||||
}, 100);
|
||||
|
||||
Reference in New Issue
Block a user