Tabulator scrolling to top all the time

I have a question on the Tabulator model in panel. I have created a Bug issue some time ago (Tabulator scrolls to top when other element on the page changes · Issue #4451 · holoviz/panel · GitHub), about the Table scrolling to the top all the time when something on the page is updated. I think this is solved in Panel 1.0, I assume by the DOM Shadow roots isolation somehow.

I do however still have the issue of scrolling to Row 0 after setting or patching the data. Looking into the source code, I found that on every patch, the element.scrollTop is set to this._lastVerticalScrollbarTopPosition. However, as far as I can see, this variable is initialised to 0, but never set to any other value. As such the scroll position is manually set to 0 on every patch.

Did I perhaps miss the point where the _lastVerticalScrollbarTopPosition is set, or is there a valid reason to always have the scroll position set it to 0?

I am not sure if the javascript tabulator object can patch without scroll position effects. In my usecase I patch a cell onclick, and ideally the cell would not move on patch. Could removing this scrollpos line perhaps achieve that?

Thanks and regards,

I have found a commit where the last line setting the _lastVerticalScrollbarTopPosition variable was deleted. Was the code still using this variable perhaps forgotten here? (@maximlt )

1 Like

Im experiencing the same issue, did you ever find a fix @Wijnko ?

Does anyone know a fix to this? Maybe @maximlt ?

Hi @rsdenijs , I did find a fix in changing the two lines in the code as described here:
Tabulator Patch always resets scroll position · Issue #5000 · holoviz/panel · GitHub (unfortunately the lines referenced don’t match to the current source code anymore)

But this fix has not been implemented yet, although it is planned in the milestone for the next release for a long time. For my project I currently use a custom local version of the panel package, with these two lines changed such that I can use it with this bug removed.


Thanks @Wijnko . I tried going the same route but then it turned out it gets fixed if you set the height of the table, directly or indirectly, the problem is fixed. I commented on the ticket.

Ok, then your issue was really something else. My issue is without pagination.