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

TreeTable: onCellEditComplete not called #7635

Open
MBelniak opened this issue Jan 22, 2025 · 2 comments · May be fixed by #7636
Open

TreeTable: onCellEditComplete not called #7635

MBelniak opened this issue Jan 22, 2025 · 2 comments · May be fixed by #7636
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.

Comments

@MBelniak
Copy link
Contributor

Describe the bug

When editing a cell in TreeTable, the onCellEditComplete is not called, making it impossible to fire a request to backend etc.
Also, I found out that due to switchCellToViewMode being bound to document's click event listener, the callback provided to onCellEditCompleted is bound to stale component's state, thus it's crucial to use a callback mode of setState to work on fresh data - I added such info in the docs, both for DataTable and TreeTable.
There was also an issue with the editor keeping old data after canceling the edition. I fixed that so after escaping a cell editor and opening it again, the state of editor is reset.

When it comes to reproducers, the ones existing in the docs are enough.
I'm working on the version 10.9.1 of primereact.

Reproducer

https://stackblitz.com/run?file=src%2FApp.jsx

System Information

System:
    OS: Windows 11 10.0.22631
    CPU: (16) x64 AMD Ryzen 7 6800H with Radeon Graphics
    Memory: 17.10 GB / 31.25 GB
  Binaries:
    Node: 20.9.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.1.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.5.1 - ~\AppData\Roaming\npm\pnpm.CMD
  Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.22621.3527
  npmPackages:
    react: 18.3.1 => 18.3.1

Steps to reproduce the behavior

  1. Render a TreeTable with onCellEditComplete callback.
  2. Edit a cell and click away.

Expected behavior

The callback should be called after the cell completion is finished, but it is not.

@MBelniak MBelniak added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jan 22, 2025
@MBelniak
Copy link
Contributor Author

#7636

@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jan 22, 2025
@melloware melloware added this to the 10.9.2 milestone Jan 22, 2025
@melloware melloware removed this from the 10.9.2 milestone Jan 22, 2025
@MBelniak
Copy link
Contributor Author

MBelniak commented Jan 22, 2025

@melloware I am aware that this is a significant change, please inform me if there is anything I can do to increase the chance of merging it.

@melloware melloware changed the title [TreeTable] onCellEditComplete not called TreeTable: onCellEditComplete not called Jan 22, 2025
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
2 participants