Component: ColumnManagementModal with enableDragDrop={true}
Description
When using ColumnManagementModal with drag-and-drop enabled, the "Reset to default" button only resets column visibility (isShown back to isShownByDefault) but does not restore the original column order.
The resetToDefault function maps over appliedColumns preserving their current (reordered) positions:
const resetToDefault = () => {
setCurrentColumns(appliedColumns.map(column => ({
...column,
isShown: column.isShownByDefault ?? false
})));
onReset?.();
};
Steps to reproduce
- Render a ColumnManagementModal with enableDragDrop={true} and multiple columns
- Drag columns to reorder them (e.g., move the last column to the first position)
- Click "Save" to apply the new order
- Reopen the modal
- Click "Reset to default"
- Observe that column visibility is restored but the order remains as reordered in step 2
Expected behavior
I think "Reset to default" should restore both column visibility and column order to their original state as defined by the initial appliedColumns prop.
Actual behavior
Only visibility is reset. The column order from the last save is preserved.