Skip to content

Commit 012f2cd

Browse files
committed
fix(sim-links): forget a row's menu when the row leaves the results
1 parent 21fb876 commit 012f2cd

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎apps/sim/app/o/[organizationId]/links/sim-links.tsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ export function SimLinks({ organizationId }: SimLinksProps) {
9191
const loaded = useMemo(() => links.data?.pages.flatMap((page) => page.links) ?? [], [links.data])
9292
const linksById = useMemo(() => new Map(loaded.map((link) => [link.id, link])), [loaded])
9393
const menuLink = menuLinkId ? linksById.get(menuLinkId) : undefined
94+
// A row can leave the results while its menu is open; forgetting it keeps the menu from
95+
// reappearing at the old position when the row comes back.
96+
if (menuLinkId && !menuLink) setMenuLinkId(null)
9497

9598
const rows: ResourceRow[] = useMemo(
9699
() =>

0 commit comments

Comments
 (0)