fix(BlockEditor): preserve selected index only when block id and query match

This commit is contained in:
2026-04-25 19:16:09 -04:00
parent d859874122
commit b4bebfd1bd
@@ -345,7 +345,7 @@ export default function BlockEditor({
blockId,
query,
anchorRect: rect,
selectedIndex: prev?.blockId === blockId ? prev.selectedIndex ?? 0 : 0,
selectedIndex: (prev?.blockId === blockId && prev?.query === query) ? (prev.selectedIndex ?? 0) : 0,
}));
}