You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of the getResizeHandler function in the ColumnSizing feature doesn't properly handle the document context in all scenarios, particularly in environments where the global document object might not be available or when dealing with new windows and React.createPortal.
The resize handler should work correctly in various environments, including iframes and server-side rendering scenarios.
It should prioritize the explicitly provided document context.
It should gracefully handle cases where the global document object is not available.
Current Behaviour
The current implementation may not work correctly in all scenarios, particularly when dealing with windows/iframes or in environments where the global document object is not available.
Do you intend to try to help solve this bug with your own PR?
Yes, I am also opening a PR that solves the problem along side this issue
Terms & Code of Conduct
I agree to follow this project's Code of Conduct
I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
The text was updated successfully, but these errors were encountered:
parassantra
changed the title
## Bug Report: Improve document context handling in ColumnSizing feature
Improve document context handling in ColumnSizing feature
Sep 16, 2024
TanStack Table version
v8.20.5
Framework/Library version
v18.2.0
Describe the bug and the steps to reproduce it
Description
The current implementation of the
getResizeHandler
function in theColumnSizing
feature doesn't properly handle the document context in all scenarios, particularly in environments where the globaldocument
object might not be available or when dealing with new windows and React.createPortal.Proposed Change
typescript:packages/table-core/src/features/ColumnSizing.ts
const contextDocument =
contextDocument ||
(typeof document !== 'undefined'
? (((e as MouseEvent | TouchEvent).target as Element)?.ownerDocument ?? document)
: null)
Expected Behaviour
document
object is not available.Current Behaviour
The current implementation may not work correctly in all scenarios, particularly when dealing with windows/iframes or in environments where the global
document
object is not available.Steps to Reproduce
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
https://codesandbox.io/p/sandbox/github/parassantra/react-table-issue
Screenshots or Videos (Optional)
Screen.Recording.2024-09-15.at.21.40.25.mov
Do you intend to try to help solve this bug with your own PR?
Yes, I am also opening a PR that solves the problem along side this issue
Terms & Code of Conduct
The text was updated successfully, but these errors were encountered: