- Shipped
- April 25, 2026 at 10:10 PM UTC
- Author
- kamo
- Commit
- 4e54fad
Shadow DOM was the root cause. Wide email content (fixed-width tables) inside the shadow tree painted past the host without contributing to the host's layout box, so the parent body wrapper's overflow-x-auto never detected the overflow and never produced a scrollbar. Replacing the shadow root with a plain div + dangerouslySetInnerHTML makes the email body's wide descendants regular DOM children of the scroll container, which correctly triggers the horizontal scrollbar inside the email body. The message header is a sibling of the body wrapper, so it stays at column width and is unaffected. Sanitization (sanitizeEmailHtml) still runs and is the security boundary; the shadow tree was an extra CSS-isolation layer, not the sanitizer itself.