From de23227ea72d5806f00a0731643414ca085d666c Mon Sep 17 00:00:00 2001 From: Jag <77469789+jag3dagster@users.noreply.github.com> Date: Sat, 29 Oct 2022 01:11:40 -0700 Subject: [PATCH] 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 --- web/src/features/menu/list/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/features/menu/list/index.tsx b/web/src/features/menu/list/index.tsx index 42c82f1..fd5d1f1 100644 --- a/web/src/features/menu/list/index.tsx +++ b/web/src/features/menu/list/index.tsx @@ -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);