Skip to content

Commit

Permalink
Improve column resize event behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
jassmith committed Apr 14, 2022
1 parent d7aaa36 commit dcde7ca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core/src/data-grid-dnd/data-grid-dnd.tsx
Expand Up @@ -123,7 +123,9 @@ const DataGridDnd: React.FunctionComponent<DataGridDndProps> = p => {
onColumnResized?.(columns[c], lastResizeWidthRef.current);
}

onColumnResizedEnd?.(columns[resizeCol], lastResizeWidthRef.current);
for (const c of selectedColumns) {
if (c === resizeCol) continue;
onColumnResizedEnd?.(columns[c], lastResizeWidthRef.current);
}
}
Expand Down Expand Up @@ -192,7 +194,7 @@ const DataGridDnd: React.FunctionComponent<DataGridDndProps> = p => {
onColumnResized?.(column, newWidth);
lastResizeWidthRef.current = newWidth;

if (resizeCol !== undefined && selectedColumns?.first() === resizeCol) {
if (selectedColumns?.first() === resizeCol) {
for (const c of selectedColumns) {
if (c === resizeCol) continue;
onColumnResized?.(columns[c], lastResizeWidthRef.current);
Expand Down

0 comments on commit dcde7ca

Please sign in to comment.