Skip to content

fix(table): add table-wrapper to fullscreen portal so copy/download work#470

Open
sleitor wants to merge 1 commit intovercel:mainfrom
sleitor:fix-468
Open

fix(table): add table-wrapper to fullscreen portal so copy/download work#470
sleitor wants to merge 1 commit intovercel:mainfrom
sleitor:fix-468

Conversation

@sleitor
Copy link
Contributor

@sleitor sleitor commented Mar 17, 2026

Summary

Fixes copy and download buttons being unresponsive when a table is in fullscreen mode.

Root Cause

TableCopyDropdown and TableDownloadDropdown both use:

dropdownRef.current?.closest('[data-streamdown="table-wrapper"]')

to locate the <table> element. When the fullscreen overlay is rendered via createPortal (appended to document.body), the DOM ancestry is severed — none of the portal's ancestors have data-streamdown="table-wrapper", so closest() returns null and the copy/download actions silently fail.

Fix

Add data-streamdown="table-wrapper" to the inner role="presentation" div inside the fullscreen portal. This restores the ancestor chain that the dropdowns rely on to find the table.

Testing

Added a test to table-fullscreen.test.tsx verifying that [data-streamdown="table-wrapper"] and [data-streamdown="table"] are accessible inside the fullscreen overlay. All 983 tests pass.

Closes #468

TableCopyDropdown and TableDownloadDropdown both use
  dropdownRef.current?.closest('[data-streamdown="table-wrapper"]')
to locate the table element. When rendered inside a React portal
(document.body), the DOM ancestry is severed, so closest() returns null
and the copy/download actions silently do nothing.

Fix: add data-streamdown="table-wrapper" to the inner presentation div
inside the fullscreen portal so the closest() traversal can succeed.

Closes vercel#468
@vercel
Copy link
Contributor

vercel bot commented Mar 17, 2026

@sleitor is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

It cannot be copied or downloaded in full-screen table.

1 participant