Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(soup): first entity not always focused on load (#2771)

dev-rbf367e745deb3
diff --git a/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx b/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
index 50f48361cb..7a9cc9ffac 100644
--- a/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
@@ -434,8 +434,12 @@ export const SoupViewList = (props: SoupViewListProps) => {
let initialLoad = true;
// Initial load: focus first entity once rows arrive
+ // There can be a case where the data may have arrived but the focusEffectsEnabled
+ // and moveInitialFocus were not set correctly by the methods below. So
+ // we need to also use them as deps for this effect. `initialLoad` should
+ // handle not running after the initial load
createEffect(
- on(rows, () => {
+ on([rows, focusEffectsEnabled, moveInitialFocus], () => {
if (!focusEffectsEnabled() || !moveInitialFocus()) return;
if (!initialLoad || source.isLoading()) return;
focusFirstEntity();