olifolkerd / tabulator

Interactive Tables and Data Grids for JavaScript
http://tabulator.info
MIT License
6.76k stars 821 forks source link

DataTree rendering can result in maximum call stack size exceeded #4599

Open s-cork opened 1 month ago

s-cork commented 1 month ago

Describe the bug Enough TreeData when expanded can cause Uncaught RangeError: Maximum call stack size exceeded

Tabulator Info

Working Example

To Reproduce A step by step guide to recreate the issue in your JS Fiddle or Codepen:

  1. Go to https://jsfiddle.net/sc549/fdzbvngm/
  2. Expand row 1 followed by row 2 (possibly followed by row 3)
  3. Observe the page freezes
  4. Eventually the error will show in dev tools
VirtualDomVertical.js:92 Uncaught RangeError: Maximum call stack size exceeded
    at VirtualDomVertical.js:92:17
    at Array.forEach (<anonymous>)
    at b.rerenderRows (VirtualDomVertical.js:92:8)
    at f.reRenderInPosition (RowManager.js:854:18)
    at f.redraw (RowManager.js:1116:9)
    at ResizeTableModule.tableResized (ResizeTable.js:138:25)
    at InternalEventBus.js:119:25
    at Array.forEach (<anonymous>)
    at R._dispatch (InternalEventBus.js:118:21)
    at f.dispatch (CoreFeature.js:78:30)

Desktop (please complete the following information):

Additional context It doesn't seem to be a problem in 5.x

schwarmco commented 1 month ago

i just tried the fiddle with the patched version of #4598 and it seems to be fixed by that, so the expanding/collapsing triggers the same recursive rendering behavior as in #4467