Skip to content

fix: restore table copy and download actions in fullscreen mode#568

Open
aradhyacp wants to merge 5 commits into
vercel:mainfrom
aradhyacp:fix/table-fullscreen-copy-download
Open

fix: restore table copy and download actions in fullscreen mode#568
aradhyacp wants to merge 5 commits into
vercel:mainfrom
aradhyacp:fix/table-fullscreen-copy-download

Conversation

@aradhyacp

Copy link
Copy Markdown
Contributor

Description

This PR fixes an issue where the table Copy and Download controls silently failed when used from the fullscreen table view.

The fullscreen table is rendered using a React portal with a data-streamdown="table-fullscreen" container. The copy and download actions previously located the target table by searching for the nearest data-streamdown="table-wrapper" ancestor. Because portals break DOM ancestry, the lookup failed in fullscreen mode, causing the controls to report "Table not found" and perform no action.

This change broadens the table lookup to support both inline and fullscreen table containers, restoring copy and download functionality without changing the existing behavior for inline tables.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Refactoring (no functional changes)

Related Issues

Fixes #567
Closes #567
Related to #567

Changes Made

  • Updated table lookup logic to support both inline and fullscreen table containers.
  • Restored copy functionality for tables displayed in fullscreen mode.
  • Restored download functionality for tables displayed in fullscreen mode.

Testing

  • All existing tests pass
  • Added new tests for the changes
  • Manually tested the changes

Test Coverage

Manually tested the copy functionality using a local React app.

How I tested it locally:

I used the following test component to verify table rendering and copying behavior:

import { Streamdown } from "streamdown";
import "streamdown/styles.css";

const App = () => {
  const markdown = `
| Feature | Status | Notes |
|:--------|:------:|------:|
| Markdown | Supported | CommonMark compliant |
| GFM | Supported | Tables, tasks, strikethrough |
| Code highlighting | Supported | 200+ languages via Shiki |
| Math | Supported | KaTeX rendering |
| Mermaid | Supported | Flowcharts, sequences, and more |
| CJK | Supported | Chinese, Japanese, Korean |

`;

  return (
    <div className="App">
      <div className="mx-auto mt-5 w-200">
        <Streamdown>{markdown}</Streamdown>
      </div>
    </div>
  );
};

export default App;

Verified that:

Copy actions work correctly from the inline table.
Copy actions work correctly from the fullscreen table.
Download actions work correctly from the inline table.
Download actions work correctly from the fullscreen table.

Screenshots/Demos

Screen.Recording.2026-07-23.at.12.32.55.AM.mov

Checklist

  • My code follows the project's code style
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have created a changeset (pnpm changeset)

Changeset

  • I have created a changeset for these changes

Additional Notes

This fix intentionally takes the minimal approach by supporting table lookup within both table-wrapper and table-fullscreen containers.

A larger architectural refactor to pass table references directly (instead of relying on DOM traversal) was considered but is outside the scope of this bug fix. The current solution restores the expected functionality while preserving the existing implementation and API.

@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

@aradhyacp 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.

Table copy/download actions silently fail in fullscreen mode (closest('[data-streamdown="table-wrapper"]') breaks across the portal)

1 participant