schummar-table 0.50.0 → 0.50.3
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.
- package/dist/index.cjs +3 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +9 -6
package/dist/index.js
CHANGED
|
@@ -3101,6 +3101,7 @@ function ResizeHandle() {
|
|
|
3101
3101
|
const table = useTableContext();
|
|
3102
3102
|
const columnId = useColumnContext();
|
|
3103
3103
|
const enabled = table.useState((state) => state.props.enableColumnResize);
|
|
3104
|
+
const hasFilter = table.useState((state) => state.filters.get(columnId) !== void 0);
|
|
3104
3105
|
function onPointerDown(event) {
|
|
3105
3106
|
event.stopPropagation();
|
|
3106
3107
|
event.target.setPointerCapture(event.pointerId);
|
|
@@ -3110,7 +3111,8 @@ function ResizeHandle() {
|
|
|
3110
3111
|
const div = event.target;
|
|
3111
3112
|
if (!div.hasPointerCapture(event.pointerId)) return;
|
|
3112
3113
|
const parent = div.parentElement;
|
|
3113
|
-
const
|
|
3114
|
+
const minWidth = hasFilter ? 80 : 50;
|
|
3115
|
+
const width = Math.max(event.clientX - parent.getBoundingClientRect().left + 5, minWidth);
|
|
3114
3116
|
table.update((state) => {
|
|
3115
3117
|
state.columnWidths.set(columnId, `${width}px`);
|
|
3116
3118
|
});
|