Skip to content

Commit

Permalink
Fix #3796: TreeTable error in resize expand mode (#3797)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Dec 18, 2022
1 parent f0e7e19 commit 4120d5c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions components/lib/treetable/TreeTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import PrimeReact, { FilterMatchMode, FilterService } from '../api/Api';
import { useEventListener } from '../hooks/Hooks';
import { Paginator } from '../paginator/Paginator';
import { classNames, DomHandler, ObjectUtils } from '../utils/Utils';
import { DomHandler, ObjectUtils, classNames } from '../utils/Utils';
import { TreeTableBody } from './TreeTableBody';
import { TreeTableFooter } from './TreeTableFooter';
import { TreeTableHeader } from './TreeTableHeader';
Expand All @@ -18,6 +18,7 @@ export const TreeTable = React.forwardRef((props, ref) => {
const [filtersState, setFiltersState] = React.useState(props.filters);
const [columnOrderState, setColumnOrderState] = React.useState([]);
const elementRef = React.useRef(null);
const tableRef = React.useRef(null);
const resizerHelperRef = React.useRef(null);
const reorderIndicatorUpRef = React.useRef(null);
const reorderIndicatorDownRef = React.useRef(null);
Expand Down Expand Up @@ -345,7 +346,7 @@ export const TreeTable = React.forwardRef((props, ref) => {
resizeColGroup(scrollableBodyTable, resizeColumnIndex, newColumnWidth, null);
resizeColGroup(scrollableFooterTable, resizeColumnIndex, newColumnWidth, null);
} else {
table.style.width = table.offsetWidth + delta + 'px';
tableRef.current.style.width = tableRef.current.offsetWidth + delta + 'px';
resizeColumn.current.style.width = newColumnWidth + 'px';
}
}
Expand Down Expand Up @@ -930,7 +931,7 @@ export const TreeTable = React.forwardRef((props, ref) => {

return (
<div className="p-treetable-wrapper">
<table style={props.tableStyle} className={props.tableClassName}>
<table ref={tableRef} style={props.tableStyle} className={props.tableClassName}>
{header}
{footer}
{body}
Expand Down

0 comments on commit 4120d5c

Please sign in to comment.