Skip to content

Commit

Permalink
Fix styling offset for Tabulator (#3551)
Browse files Browse the repository at this point in the history
* Fix styling offset for Tabulator

* Update test
  • Loading branch information
philippjfr committed May 23, 2022
1 parent 0dab3ba commit 1a168b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions panel/tests/widgets/test_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,11 +663,11 @@ def high_red(value):
model = table.get_root(document, comm)

assert model.styles['data'] == {
0: {1: [('color', 'black')]},
1: {1: [('color', 'black')]},
2: {1: [('color', 'black')]},
3: {1: [('color', 'red')]},
4: {1: [('color', 'red')]}
0: {2: [('color', 'black')]},
1: {2: [('color', 'black')]},
2: {2: [('color', 'black')]},
3: {2: [('color', 'red')]},
4: {2: [('color', 'red')]}
}

def test_tabulator_empty_table(document, comm):
Expand Down
2 changes: 1 addition & 1 deletion panel/widgets/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,7 @@ def _get_style_data(self, recompute=True):
styler = self._computed_styler
if styler is None:
return {}
offset = len(self.indexes) + int(self.selectable in ('checkbox', 'checkbox-single')) + int(bool(self.row_content))
offset = 1 + len(self.indexes) + int(self.selectable in ('checkbox', 'checkbox-single')) + int(bool(self.row_content))
if self.pagination == 'remote':
start = (self.page-1)*self.page_size
end = start + self.page_size
Expand Down

0 comments on commit 1a168b5

Please sign in to comment.