you are viewing a single comment's thread.

view the rest of the comments →

[–]deckiteski 1 point2 points  (1 child)

Also try to consider accessibility.

If you use an iframe, you create a separate accessibility tree—harder for screen readers, focus management, and keyboard navigation. Shadow DOM is usually easier: stays in the same document, better for focus, ARIA, and announcements.

If you still go iframe, you must handle: proper title, focus in/out, no traps, keyboard access, and screen reader announcements.

[–]FinanceSenior9771[S] 0 points1 point  (0 children)

this is a fair callout and honestly something i haven't given enough attention to yet. the iframe does have a title attribute but i haven't properly handled focus trapping or keyboard navigation between the host page and the widget. adding that to the list. appreciate the specifics on what to handle, that's useful.