Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix:#6141:DataTable:Column: onCellEditComplete is fired twice #6641

Merged
merged 3 commits into from
May 20, 2024

Conversation

kl-nevermore
Copy link
Contributor

@kl-nevermore kl-nevermore commented May 20, 2024

Fix #6141
Fix #6019
Fix #5556

Copy link

vercel bot commented May 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
primereact ⬜️ Ignored (Inspect) Visit Preview May 20, 2024 11:53am
primereact-v9 ⬜️ Ignored (Inspect) Visit Preview May 20, 2024 11:53am

@didix16
Copy link
Contributor

didix16 commented May 20, 2024

Hey @kl-nevermore, I think editingRowDataStateRef.current = getEditingRowData() should be added after line 522

useUpdateEffect(() => {
if (props.editMode === 'cell' || props.editMode === 'row') {
setEditingRowDataState(getEditingRowData());
}
}, [props.editingMeta]);

It should also update there the state ref, right?

Edit

Well it must be something like:

const editingRowData =  getEditingRowData();
setEditingRowDataState(editingRowData);
editingRowDataStateRef.current = editingRowData;

@kl-nevermore
Copy link
Contributor Author

Yes, I missed this.
Maybe it would be better to use useeffect.

@melloware melloware added the Type: Bug Issue contains a defect related to a specific component. label May 20, 2024
@melloware
Copy link
Member

@kl-nevermore thanks for this let me know when its ready for review!

@melloware melloware self-requested a review May 20, 2024 11:33
@kl-nevermore
Copy link
Contributor Author

@melloware
I updated code, please review thanks!

@melloware melloware merged commit ecd37b6 into primefaces:master May 20, 2024
5 checks passed
@melloware
Copy link
Member

This is a much better fix and removes the hack i added!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
3 participants