@tanstack/react-table 8.11.3 → 8.11.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -635,7 +635,8 @@
|
|
|
635
635
|
}
|
|
636
636
|
return 0;
|
|
637
637
|
};
|
|
638
|
-
header.getResizeHandler =
|
|
638
|
+
header.getResizeHandler = _contextDocument => {
|
|
639
|
+
const contextDocument = _contextDocument || document;
|
|
639
640
|
const column = table.getColumn(header.column.id);
|
|
640
641
|
const canResize = column == null ? void 0 : column.getCanResize();
|
|
641
642
|
return e => {
|
|
@@ -695,8 +696,8 @@
|
|
|
695
696
|
const mouseEvents = {
|
|
696
697
|
moveHandler: e => onMove(e.clientX),
|
|
697
698
|
upHandler: e => {
|
|
698
|
-
|
|
699
|
-
|
|
699
|
+
contextDocument.removeEventListener('mousemove', mouseEvents.moveHandler);
|
|
700
|
+
contextDocument.removeEventListener('mouseup', mouseEvents.upHandler);
|
|
700
701
|
onEnd(e.clientX);
|
|
701
702
|
}
|
|
702
703
|
};
|
|
@@ -711,8 +712,8 @@
|
|
|
711
712
|
},
|
|
712
713
|
upHandler: e => {
|
|
713
714
|
var _e$touches$;
|
|
714
|
-
|
|
715
|
-
|
|
715
|
+
contextDocument.removeEventListener('touchmove', touchEvents.moveHandler);
|
|
716
|
+
contextDocument.removeEventListener('touchend', touchEvents.upHandler);
|
|
716
717
|
if (e.cancelable) {
|
|
717
718
|
e.preventDefault();
|
|
718
719
|
e.stopPropagation();
|
|
@@ -724,11 +725,11 @@
|
|
|
724
725
|
passive: false
|
|
725
726
|
} : false;
|
|
726
727
|
if (isTouchStartEvent(e)) {
|
|
727
|
-
|
|
728
|
-
|
|
728
|
+
contextDocument.addEventListener('touchmove', touchEvents.moveHandler, passiveIfSupported);
|
|
729
|
+
contextDocument.addEventListener('touchend', touchEvents.upHandler, passiveIfSupported);
|
|
729
730
|
} else {
|
|
730
|
-
|
|
731
|
-
|
|
731
|
+
contextDocument.addEventListener('mousemove', mouseEvents.moveHandler, passiveIfSupported);
|
|
732
|
+
contextDocument.addEventListener('mouseup', mouseEvents.upHandler, passiveIfSupported);
|
|
732
733
|
}
|
|
733
734
|
table.setColumnSizingInfo(old => ({
|
|
734
735
|
...old,
|