diff --git a/packages/table-core/src/features/ColumnSizing.ts b/packages/table-core/src/features/ColumnSizing.ts index 3cce2ddcb2..ecf8e1ecc9 100644 --- a/packages/table-core/src/features/ColumnSizing.ts +++ b/packages/table-core/src/features/ColumnSizing.ts @@ -429,7 +429,11 @@ export const ColumnSizing: TableFeature = { } const contextDocument = - _contextDocument || typeof document !== 'undefined' ? document : null + _contextDocument || + (typeof document !== 'undefined' + ? ((e as MouseEvent | TouchEvent).target as Element) + ?.ownerDocument ?? document + : null) const mouseEvents = { moveHandler: (e: MouseEvent) => onMove(e.clientX),