Skip to content

Build your personal knowledge base with Trilium Notes

client/text editor: fix a scroll drift on Firefox when table headers are floating

Adorian Doran8de630d368cf
diff --git a/packages/ckeditor5/src/plugins/table_sticky_header_read_only.spec.ts b/packages/ckeditor5/src/plugins/table_sticky_header_read_only.spec.ts
index b1a3627385..e4cd24719e 100644
--- a/packages/ckeditor5/src/plugins/table_sticky_header_read_only.spec.ts
+++ b/packages/ckeditor5/src/plugins/table_sticky_header_read_only.spec.ts
@@ -45,6 +45,7 @@ describe("applyStickyTableHeaders", () => {
await scrollTo(scroller, offsetIn(scroller, thead) + 150);
expect(topIn(scroller, thead)).toBeCloseTo(0, 0);
expect(bordersOf(thead)).toBe("block");
+ expect(getComputedStyle(thead).overflowAnchor).toBe("none");
const hit = document.elementFromPoint(
thead.getBoundingClientRect().left + 10, scroller.getBoundingClientRect().top + 5);
expect(hit?.closest("thead")).toBe(thead);
diff --git a/packages/ckeditor5/src/theme/table_sticky_header.css b/packages/ckeditor5/src/theme/table_sticky_header.css
index 55f074e3c8..9a5ca23690 100644
--- a/packages/ckeditor5/src/theme/table_sticky_header.css
+++ b/packages/ckeditor5/src/theme/table_sticky_header.css
@@ -16,6 +16,7 @@
Firefox, `--table-header-easing`. */
> table > thead {
position: relative;
+ overflow-anchor: none;
animation-name: table-header-stick, table-header-stuck;
animation-duration: auto;
animation-timing-function: var(--table-header-easing, linear);