Skip to content

fix(table-core): respect resize handler context document#6435

Merged
KevinVandy merged 1 commit into
betafrom
agent/fix-4483-portal-resize
Jul 17, 2026
Merged

fix(table-core): respect resize handler context document#6435
KevinVandy merged 1 commit into
betafrom
agent/fix-4483-portal-resize

Conversation

@KevinVandy

@KevinVandy KevinVandy commented Jul 17, 2026

Copy link
Copy Markdown
Member

What changed

  • respect the Document passed to header.getResizeHandler
  • add a regression test that verifies resize listeners attach to that document

Why

The context-document fallback mixed || with a conditional expression without parentheses. In browser environments, that made the global document win even when a portal or detached-window document was explicitly supplied, so move and up events were observed on the wrong page.

This restores the existing API's intended behavior without adding new surface area.

Validation

  • all @tanstack/table-core tests: 52 files, 1,002 tests passed
  • Prettier check passed
  • git diff --check passed

Closes #4483

Summary by CodeRabbit

  • Bug Fixes

    • Improved column resizing behavior when operating with a provided document context.
    • Ensured resize event listeners attach to the intended document in supported environments.
  • Tests

    • Added coverage confirming mouse movement and release events use the provided document context.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9cb33ade-9609-4d51-97f6-826213157d65

📥 Commits

Reviewing files that changed from the base of the PR and between a4040a2 and 55bdcc5.

📒 Files selected for processing (2)
  • packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts
  • packages/table-core/tests/unit/features/column-resizing/columnResizingFeature.utils.test.ts

📝 Walkthrough

Walkthrough

The column resize handler now correctly selects a provided context document when initializing its event-listener target. A unit test verifies that mousemove and mouseup listeners attach to that document.

Changes

Column resizing document targeting

Layer / File(s) Summary
Document context selection and validation
packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts, packages/table-core/tests/unit/features/column-resizing/columnResizingFeature.utils.test.ts
The fallback ternary for contextDocument is parenthesized, and a test verifies resize listeners attach to an explicitly supplied document.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main fix: respecting the resize handler's context document.
Linked Issues check ✅ Passed The changes address #4483 by attaching resize listeners to the provided document and adding a regression test.
Out of Scope Changes check ✅ Passed The diff stays focused on the portal/document-resizing bug fix and its test coverage.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/fix-4483-portal-resize

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Jul 17, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 55bdcc5

Command Status Duration Result
nx affected --targets=test:eslint,test:sherif,t... ✅ Succeeded 8m 31s View ↗
nx run-many --targets=build --exclude=examples/** ✅ Succeeded 49s View ↗

☁️ Nx Cloud last updated this comment at 2026-07-17 20:28:52 UTC

@pkg-pr-new

pkg-pr-new Bot commented Jul 17, 2026

Copy link
Copy Markdown
More templates

@tanstack/alpine-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/alpine-table@6435

@tanstack/angular-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/angular-table@6435

@tanstack/angular-table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/angular-table-devtools@6435

@tanstack/ember-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/ember-table@6435

@tanstack/lit-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/lit-table@6435

@tanstack/match-sorter-utils

npm i https://pkg.pr.new/TanStack/table/@tanstack/match-sorter-utils@6435

@tanstack/preact-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/preact-table@6435

@tanstack/preact-table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/preact-table-devtools@6435

@tanstack/react-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/react-table@6435

@tanstack/react-table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/react-table-devtools@6435

@tanstack/solid-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/solid-table@6435

@tanstack/solid-table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/solid-table-devtools@6435

@tanstack/svelte-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/svelte-table@6435

@tanstack/table-core

npm i https://pkg.pr.new/TanStack/table/@tanstack/table-core@6435

@tanstack/table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/table-devtools@6435

@tanstack/vue-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/vue-table@6435

@tanstack/vue-table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/vue-table-devtools@6435

commit: 55bdcc5

@KevinVandy
KevinVandy marked this pull request as ready for review July 17, 2026 21:56
@KevinVandy
KevinVandy merged commit 8f7a873 into beta Jul 17, 2026
9 checks passed
@KevinVandy
KevinVandy deleted the agent/fix-4483-portal-resize branch July 17, 2026 22:01
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.

useResizeColumns doesn't work with React Portal in new window

1 participant