From fc05526981dba55513c8062b31c1c17179247643 Mon Sep 17 00:00:00 2001 From: santrap Date: Sun, 15 Sep 2024 21:55:49 -0400 Subject: [PATCH] fix(table-core): refine contextDocument assignment in ColumnSizing --- packages/table-core/src/features/ColumnSizing.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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),