komarovalexander / ka-table

Lightweight MIT React Table component with Sorting, Filtering, Grouping, Virtualization, Editing and many more

Home Page:http://ka-table.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Validation on new row always has rowData undefined

simontherry opened this issue · comments

Hi,

The signature of validation provides the following function:

export declare type ValidationFunc = (props: {
    value: any;
    rowData: any;
    column: Column;
}) => string | void;

However, when saving a new row, the following occurs:

var updatedRowData_1 = data.find(function (d) { return DataUtils_1.getValueByField(d, rowKeyField) === rowEditorKeyValue_1; });

Where the "data" does not contain the row that was just added, so in the code below:

cell.validationMessage = validation && validation({
                        column: column,
                        value: cell.editorValue,
                        rowData: updatedRowData_1
                    });

the validation function does not inject the correct rowData.

Can this be fixed such that rowData in the validation func is the data from the newly added row?

Thanks!

looks like it is the similar with #274 and it should be already fixed

Indeed seems to be the same issue. Any idea when we can expect the new version?

@simontherry It is already released. Use v7.8.4