@adrian.szymanski
I changes to height of table by the number of rows (input) every time so i copy the logic for this too.
(I dont think this the problem)
const updateDynamicHeight = () => {
const rowHeight = 30;
const space = 48;
const numberOfRows = formData.graphData?.rowsNumber || 10;
const calculatedHeight = rowHeight * numberOfRows + space;
setDynamicHeight(`${calculatedHeight}px`);
};
useEffect(() => {
updateDynamicHeight();
}, [formData.graphData?.rowsNumber]);
<HotTable
ref={tableDataRef}
data={tableData}
height="auto"
width="100%"
rowHeights={30}
readOnly={readOnly}
colWidths={150}
rowHeaderWidth={25}
rowHeaders={()=> ''}
comments={true}
dropdownMenu={true}
filters={true}
className="table-style"
fixedRowsTop={1}
hiddenColumns={{
indicators: true,
}}
afterCreateRow={() => updateFormData('rowsNumber',tableDataRef.current.hotInstance.countRows()-1)}
afterCreateCol={() => updateFormData('colsNumber',tableDataRef.current.hotInstance.countCols()-1)}
afterRemoveRow={removeCommentFromRow}
afterRemoveCol={removeCommentFromCol}
afterSetCellMeta={handleAfterSetCellMeta}
multiColumnSorting={true}
beforeRenderer={addClassesToRows}
manualRowMove={true}
autoWrapRow={true}
cells={cellStyleConfig}
navigableHeaders={true}
beforeRowMove={lockFirstRow}
afterRowMove={handleAfterRowMove}
licenseKey="non-commercial-and-evaluation"
afterChange={(changes) => handleTableChange(changes)}
columns={columnsConfig}
cell={formData.graphData?.comments}
></HotTable>