Tabulator Patch always resets scroll position #5000
Labels
component: tabulator
Related to the Tabulator widget
type: bug
Something isn't correct or isn't working
Milestone
ALL software version info
Panel 1.0.4
Bokeh 3.1.1
MacOS 12.6
Chrome Version 113.0.5672.126
Description of expected behavior and the observed behavior
Expected:
Scroll position is untouched on data patching
Observed:
Table scrolls to top after every data patch
Complete, minimal, self-contained example code that reproduces the issue
Screenshots or screencasts of the bug in action
Note:
By changing the
updateOrAddData
method and removing one line in/panel/models/tabulator.ts
, I was able to get the expected behaviour:Changes:
this.tabulator.rowManager.element.scrollTop = this._lastVerticalScrollbarTopPosition;
from the patching event handler (https://github.com/holoviz/panel/blob/v1.0.4/panel/models/tabulator.ts#L352).The
_lastVerticalScrollbarTopPosition
variable never gets set to a value other than 0 on Initialisation (https://github.com/holoviz/panel/blob/v1.0.4/panel/models/tabulator.ts#L290)this.tabulator.setData(data)
tothis.tabulator.updateOrAddData(data)
in updateOrAddData method (https://github.com/holoviz/panel/blob/v1.0.4/panel/models/tabulator.ts#L883)Result:
The text was updated successfully, but these errors were encountered: