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

Cell "edited" flag is lost on changing page when using either layoutColumnsOnNewData: true or rowHeader: { frozen: true } #4506

Open
mormitech opened this issue May 25, 2024 · 1 comment
Labels
Possible Bug A possible bug that needs investigation

Comments

@mormitech
Copy link

mormitech commented May 25, 2024

Describe the bug
When creating a table with the usual new tabulator.Tabulator("#table-container", {, using ANY of the following two attributes as options?: tabulator.Options: layoutColumnsOnNewData: true or rowHeader: { frozen: true } will break edited flag on a cell on paging.
So technically they both kill the functionality separately. This is rather 2 bugs than one, feel free to separate them.

Tabulator Info
6.2.1

Working Example
https://jsfiddle.net/echwrqzm/

To Reproduce

  1. edit the only editable cell (Mary May) and press enter
  2. navigate to page 2 and check console: table.getEditedCells() has one element
  3. navigate back to page 1 and check console: table.getEditedCells() becomes empty
    (with layoutColumnsOnNewData: true even clickin on the SAME page index down at the bottom in the pager clears the getEditedCells array)

Expected behavior
Changes (changed values and "edited" flag on the cell so technically the new value and the initial values as well) should be kept navigating to any page back and forth. Logic should not remove the "edited" flag without having explicitly calling the following:
cell.restoreInitialValue() or cell.clearEdited()

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: Chrome, latest, FF latest (supposedly browser independent)

Additional context
This is clearly a bug as turning these seemingly non-edit affecting setting off will make the issue disappear. It would be important to have a fix for these as this is supposed to be an important feature to keep changes on paging. Also, behavior is quite misleading due to the nature of the bug, since edited values are retained in a bad way, with clearing the "edited" flag, making it look like these cells have always contained their new value, but this was not the case. If the intention is to clear all changed cells upon paging (which would be a disaster and I think no other products act like this, they try to keep changes upon rendering a new page, what would be a deal of losing them with a simple rerender?) it should be consistent and clear them as soon as leaving the first page. Not when you return to original page of the changed cells.

@mormitech mormitech added the Possible Bug A possible bug that needs investigation label May 25, 2024
@mormitech mormitech changed the title Cell "edited" flag is lost on using either layoutColumnsOnNewData: true or rowHeader: { frozen: true } Cell "edited" flag is lost on changing page when using either layoutColumnsOnNewData: true or rowHeader: { frozen: true } May 25, 2024
@mormitech
Copy link
Author

mormitech commented May 26, 2024

addition to this:

  • any frozen column kills the edited flag on paging back and forth, it doesn't have to be the rowHeader
  • even if the column is actually hidden

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Possible Bug A possible bug that needs investigation
Projects
None yet
Development

No branches or pull requests

1 participant