Skip to content

Commit

Permalink
Fix #5123: DataTable: Redefine column width after resizing a column m…
Browse files Browse the repository at this point in the history
…anually
  • Loading branch information
habubey committed Oct 31, 2023
1 parent 2149601 commit 5f0c845
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions components/doc/common/apidoc/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -15598,6 +15598,12 @@
"returnType": "void",
"description": "Resets column order when reorderableColumns is enabled."
},
{
"name": "resetResizeColumnsWidth",
"parameters": [],
"returnType": "void",
"description": "Resets resize columns width."
},
{
"name": "resetScroll",
"parameters": [],
Expand Down
5 changes: 5 additions & 0 deletions components/lib/datatable/DataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -1258,6 +1258,10 @@ export const DataTable = React.forwardRef((inProps, ref) => {
}
};

const resetResizeColumnsWidth = () => {
destroyStyleElement();
};

const resetColumnOrder = () => {
const columns = getColumns(true);
let columnOrder = [];
Expand Down Expand Up @@ -1476,6 +1480,7 @@ export const DataTable = React.forwardRef((inProps, ref) => {
reset,
resetColumnOrder,
resetScroll,
resetResizeColumnsWidth,
restoreColumnWidths,
restoreState,
restoreTableState,
Expand Down
4 changes: 4 additions & 0 deletions components/lib/datatable/datatable.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1822,6 +1822,10 @@ export declare class DataTable<TValue extends DataTableValueArray> extends React
* Resets scroll position.
*/
public resetScroll(): void;
/**
* Resets resize columns width.
*/
public resetResizeColumnsWidth(): void;
/**
* Restores the column widths.
*/
Expand Down

0 comments on commit 5f0c845

Please sign in to comment.