pref(table): prevent unnecessary reflow with sticky row (#12786)

The offset of a sticky row is calculated by summing up the heights of
the previous sticky rows. As the access to the height causes a forced
reflow this is now skipped when there is only one row.
This commit is contained in:
nename0
2018-10-02 22:37:56 +02:00
committed by vivian-hu
parent 707a7ee7a5
commit 63f2ef4d7f
+4
View File
@@ -140,6 +140,10 @@ export class StickyStyler {
this._addStickyStyle(row, position, stickyHeight);
}
if (rowIndex === rows.length - 1) {
// prevent unnecessary reflow from getBoundingClientRect()
return;
}
stickyHeight += row.getBoundingClientRect().height;
}
}