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

DataTable: Edited cell values are not updated correctly after sorting and tab behavior is inconsistent #7328

Open
Oko-Tester opened this issue Oct 11, 2024 · 0 comments
Labels
Type: Bug Issue contains a defect related to a specific component.

Comments

@Oko-Tester
Copy link

Describe the bug

Description:

Description of the problem:
There are several problems when using the PrimeReact DataTable in edit mode in combination with a sort function:

Cell editing and sorting:

  • When I edit values in the “Quantity” column, I also sort the values in the table afterwards. The values are then also displayed correctly in the table. However, when I click on the same table field, the old values are displayed instead of the updated values.
  • Tab behavior: When I press the tab button to move to the next cell, the input field of the current cell is not closed and the focus remains partially in the old cell, resulting in unpredictable behavior.

If there is a problem with the reproduction of the problem, please let me know.

Reproducer

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

System Information

"primereact": "^10.8.3"

Steps to reproduce the behavior

  1. click on a cell in the Quantity column (for example, on the cell with the value “24”) and change the value to “1”.
  2. exit edit mode by clicking on another field.
  3. the table should refresh and the value in the Quantity column should now show “1”. Since the table is sorted by the Quantity column, the changed value should now be at the bottom of the table (since “1” is smaller than the other values).
  4. now search for and click on the cell that originally contained “24” and now shows “73”, for example, due to the sorting.
  5. exit edit mode by clicking on another field again.

Expected behavior

  • After editing cells, the new values in the edited cells should be saved and sorted correctly. The sorted values should be displayed correctly when the same field is clicked again.

  • When the Tab key is pressed, the input field of the current cell should be closed and editing of the next cell should be opened.

@Oko-Tester Oko-Tester added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Oct 11, 2024
@Oko-Tester Oko-Tester changed the title DataTable: Sorting updates cell values incorrectly after editing in edit mode DataTable: Edited cell values are not updated correctly after sorting and tab behavior is inconsistent Oct 11, 2024
@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 Oct 11, 2024
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
Development

No branches or pull requests

2 participants