Skip to content

Commit

Permalink
Fixed #2618: validate updated data (#2619)
Browse files Browse the repository at this point in the history
- when validating with rowEditValidator we need to use the
  updated data for validation

Co-authored-by: Rainer Burgstaller <[email protected]>
Co-authored-by: mertsincan <[email protected]>
  • Loading branch information
3 people authored Mar 29, 2022
1 parent 5b61266 commit e674d78
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/lib/datatable/BodyRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ export const BodyRow = memo((props) => {
}

const onEditSave = (e) => {
const { originalEvent: event } = e;
const valid = props.rowEditValidator ? props.rowEditValidator(props.rowData, { props: props.tableProps }) : true;
const { originalEvent: event, newData } = e;
const valid = props.rowEditValidator ? props.rowEditValidator(newData, { props: props.tableProps }) : true;

if (props.onRowEditSave) {
props.onRowEditSave({
Expand Down

0 comments on commit e674d78

Please sign in to comment.