Skip to content

fix: enhance EditorHost to support dynamic editor swapping and add CSS global shim for tests#1872

Open
paustint wants to merge 1 commit into
mainfrom
fix/render-issues
Open

fix: enhance EditorHost to support dynamic editor swapping and add CSS global shim for tests#1872
paustint wants to merge 1 commit into
mainfrom
fix/render-issues

Conversation

@paustint

Copy link
Copy Markdown
Contributor

Resolves BetterStack error 4872ea91beff23f2e58079fb4efa963c188810d1c7707a70d133d8d3fc92a1ed?s=2336599

…S global shim for tests

Resolves BetterStack error 4872ea91beff23f2e58079fb4efa963c188810d1c7707a70d133d8d3fc92a1ed?s=2336599
Copilot AI review requested due to automatic review settings July 21, 2026 14:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the data-table cell editor host against mid-edit editor-type changes by rendering the column editor as a real React component (so hooks are owned by the editor’s fiber), and it updates the test environment to support selector escaping in jsdom.

Changes:

  • Render renderEditCell via <EditCell /> (instead of invoking it as a plain function) to avoid React hooks-order crashes when the editor implementation swaps during an edit.
  • Add a regression test proving editor swapping (hookless → hook-bearing) remounts cleanly and preserves the in-progress draft row.
  • Add a minimal globalThis.CSS.escape shim in the jsdom test setup to support selector construction.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
libs/ui/src/lib/data-table/grid/editors/EditorHost.tsx Renders the active editor as a JSX component to prevent hooks-order violations during editor swapping.
libs/ui/src/lib/data-table/grid/tests/EditorHost.spec.tsx Adds a regression test covering mid-edit editor swapping and draft preservation.
libs/test-utils/src/test-setup-dom.ts Polyfills CSS.escape for jsdom so grid/editor selector logic can run in unit tests.

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.

2 participants