[AURORA-1147] - фикс расстояния между строчками при имзенеии масшаба
This commit is contained in:
parent
230090ae22
commit
f1bb6dbf6f
@ -19,6 +19,7 @@ import {
|
||||
BASE_TABLE_CONFIG,
|
||||
getTableHeadCellStyles,
|
||||
getTablePaperStyles,
|
||||
TABLE_ROW_HEIGHT,
|
||||
} from './constants/tableConfig';
|
||||
import { useRealtime } from './contexts/RealtimeContext';
|
||||
import { toast } from 'react-toastify';
|
||||
@ -66,10 +67,15 @@ const RealtimeTable = ({ formType, formId, sheetName, direction }) => {
|
||||
} = useColumnSettings(`${formId}_${formType}_${sheetName}_${direction}`);
|
||||
|
||||
const { headerPortalRef, containerRef } = useHeaderPortal();
|
||||
const rowVirtualizerRef = useRef(null);
|
||||
|
||||
const { sizeMult, setSizeMult, tableScaleStyle, tableWrapperStyle } =
|
||||
useTableScale();
|
||||
|
||||
useEffect(() => {
|
||||
rowVirtualizerRef.current?.measure?.();
|
||||
}, [sizeMult]);
|
||||
|
||||
const [columnsConfig, setColumnsConfig] = useState(null);
|
||||
|
||||
useEffect(() => {
|
||||
@ -129,10 +135,13 @@ const RealtimeTable = ({ formType, formId, sheetName, direction }) => {
|
||||
data: data,
|
||||
enableRowVirtualization: true,
|
||||
enableColumnVirtualization: true,
|
||||
rowVirtualizerInstanceRef: rowVirtualizerRef,
|
||||
rowVirtualizerOptions: {
|
||||
overscan: 30,
|
||||
scrollPaddingStart: 0,
|
||||
scrollPaddingEnd: 0,
|
||||
estimateSize: () => TABLE_ROW_HEIGHT,
|
||||
measureElement: (el) => el?.offsetHeight || TABLE_ROW_HEIGHT,
|
||||
},
|
||||
onEditingCellChange: (cell) => {
|
||||
if (cell) {
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
export const TABLE_ROW_HEIGHT = 80;
|
||||
|
||||
export const BASE_TABLE_CONFIG = {
|
||||
muiTableRowProps: {
|
||||
sx: { height: "5rem" },
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user