Skip to content

Commit 82e2977

Browse files
committed
fix collisions
1 parent 898cc64 commit 82e2977

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/context-providers/a11y-dom/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,10 @@ async function fetchIframeAXTrees(
464464
siblingPosition: 0, // TODO: Compute sibling position
465465
playwrightFrame, // Store Frame for frame resolution
466466
});
467+
468+
// Update nextFrameIndex to account for any nested frames we just merged
469+
// This prevents frameIndex collisions when processing subsequent OOPIF frames
470+
nextFrameIndex = Math.max(nextFrameIndex, ...Array.from(maps.frameMap?.keys() || [0])) + 1;
467471
} catch (error) {
468472
console.warn(
469473
`[A11y] Failed to fetch AX tree for OOPIF frame ${iframeFrameIndex} (url=${frameUrl}):`,

0 commit comments

Comments
 (0)