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

Infinite recursion on table creation #4651

Open
sjcbulldog opened this issue Dec 9, 2024 · 3 comments
Open

Infinite recursion on table creation #4651

sjcbulldog opened this issue Dec 9, 2024 · 3 comments
Labels
Possible Bug A possible bug that needs investigation

Comments

@sjcbulldog
Copy link

I do not know how to create this on JSFiddle or anywhere else as this only happens occasionally. I have tried creating smaller test cases other than my electron application, but the bug does not show. I am going to put this here and you can close without review if you so desire. I hope the display of the stack below is of help.

I create a tablulator table with four fixed columns. Rows are assigned to the table when created. The renderer process then freezes and if I use the debugger to figure out what is going on, there is an infinite recursion around resize.

Note, the problem disappears when I assign specific widths to the columns in the column descriptors.

I have worked around this by building the table with fixed widths columns and on the tableBuilt event iterating through columns and setting their width to fit content via setWidth(true).

I understand your desire to have reproducible test cases, so throw this away if it does not help, but at least here is some data on the infinite recursion that is happening for me.

_create
  _initializeTable
    setColumns
      redraw
        verticalAlignHeaders
          adjustTableSize
            dispatch <-----------------------------
              _dispatch                           |
                tableResized                      |
                  redraw                          |
                    reRenderInPosition            |
                      rerenderRows                |
                        _virtualRenderFill        |
                          adjustTableSize --------|
@sjcbulldog sjcbulldog added the Possible Bug A possible bug that needs investigation label Dec 9, 2024
@mhlozek
Copy link

mhlozek commented Dec 18, 2024

I ran into the same problem:

  • most often this problem occurs in Safari
  • only occurs with certain combinations of width/resolution and table width

The table doesn't render because the JS crashes on an infinite loop.

The bug is unfortunately very hard to reproduce :-(

@ksedgar0
Copy link

ksedgar0 commented Jan 3, 2025

I also ran into the same problem - seems to happen with layout: fitDataStretch and not with layout: fitColumns!

Details:
The error is triggered on a windows machine (on firefox, chrome, edge). It done not show up on a mac or linux machine. It also seems to happen consistently when the tabulator table is resized while using layout: fitDataStretch :

    table = new Tabulator( tableComponent, {
      data:data,
      columns:columns,
      layout:"fitDataStretch"
      });

Also happens when I use the dataTree parameter - but this time it happens on a mac, linux and windows machine. Also when using layout: "fitDataStretch".

    table = new Tabulator( tableComponent, {
      data:tree,
      dataTree:true,
      dataTreeStartExpanded:expandedState,
      layout:"fitDataStretch"
}); 

Interestingly, I dont see the recursion errors when I use layout: fitColumns!

Here is the recursion error that I see in the logs. Sometimes when the table is resized (because the pane its in changes size), I see a bunch of these recursion errors in one shot and its takes the table veryy long to render:
tabulator_recursion_error

@olifolkerd
Copy link
Owner

The dispatchExternal suggests this may be linked to an event listener you have running on the table. are you using any table events in your example?

Cheers

Oli :)

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

4 participants