Skip to content

Commit b9257c8

Browse files
committed
Add data-y attribute to datagrid td and th elements
Signed-off-by: Andrew Stein <steinlink@gmail.com>
1 parent 8c17148 commit b9257c8

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

packages/perspective-viewer-datagrid/src/js/plugin/draw.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ export async function draw(view) {
3131
const old_sizes = save_column_size_overrides.call(this);
3232
const draw = this.regular_table.draw({ invalid_columns: true });
3333
if (!this.model._preserve_focus_state) {
34-
this.regular_table.scrollTop = 0;
35-
this.regular_table.scrollLeft = 0;
3634
this.regular_table.dispatchEvent(
3735
new CustomEvent("psp-deselect-all", { bubbles: false })
3836
);

packages/perspective-viewer-datagrid/src/js/style_handlers/table_cell/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ export function table_cell_style_listener(regularTable, viewer) {
8282
cell_style_row_header.call(this, regularTable, td, metadata);
8383
}
8484

85+
tr.dataset.y = metadata.y;
86+
td.dataset.y = metadata.y;
87+
td.dataset.x = metadata.x;
8588
td.classList.toggle("psp-align-right", !is_th && is_numeric);
8689
td.classList.toggle("psp-align-left", is_th || !is_numeric);
8790
td.classList.toggle(

packages/perspective-viewer-datagrid/src/less/sub-cell-scroll.less

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table,
2525

2626
tbody tr:first-child {
2727
td,
28-
th {
28+
th,
29+
&:after {
2930
clip-path: polygon(
3031
0 var(--regular-table--clip-y, 0),
3132
0 200%,

0 commit comments

Comments
 (0)