Skip to content

Commit

Permalink
Scroll on Tabulator selection
Browse files Browse the repository at this point in the history
Scroll automatically to the selected rows when the selection is updated,
just like the DataFrame widget.

Closes #2485
  • Loading branch information
DouglasRaillard committed Jul 7, 2021
1 parent ff277ff commit 7f8ad7c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions panel/models/tabulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,8 @@ export class DataTabulatorView extends PanelHTMLBoxView {
this._selection_updating = true
this.tabulator.deselectRow()
this.tabulator.selectRow(indices)
// This actually places the selected row at the top of the table
this.tabulator.scrollToRow(indices[0], "bottom", false)
this._selection_updating = false
}

Expand Down

0 comments on commit 7f8ad7c

Please sign in to comment.