From f945833611eb16108a52f3c3a056095b78bc4fd9 Mon Sep 17 00:00:00 2001 From: ishikawa999 <14245262+ishikawa999@users.noreply.github.com> Date: Tue, 14 Apr 2026 09:40:53 +0900 Subject: [PATCH 4/4] Stabilize sticky issue header visibility --- app/assets/stylesheets/application.css | 9 +++++++++ .../controllers/sticky_table_header_controller.js | 7 +++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index cc7f26e39..55fb0a69f 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -421,6 +421,15 @@ table.list.sticky thead { top: 0; z-index: 1; } +table.list.sticky { + position: absolute; + inset: 0 auto auto 0; + inline-size: 0; + block-size: 0; + margin: 0; + border: 0; + overflow: visible; +} table.list th, .table-list-header { background-color: var(--oc-gray-2); padding: 4px; white-space: nowrap; font-weight: bold; border-block-end: 2px solid var(--oc-gray-4); } table.list th.whitespace-normal {white-space: normal;} table.list td {text-align: center; vertical-align: middle; padding-block: 3px; padding-inline-end: 10px; border-block-start: 1px solid var(--oc-gray-4);} diff --git a/app/javascript/controllers/sticky_table_header_controller.js b/app/javascript/controllers/sticky_table_header_controller.js index 7269381ca..416b32aff 100644 --- a/app/javascript/controllers/sticky_table_header_controller.js +++ b/app/javascript/controllers/sticky_table_header_controller.js @@ -98,7 +98,9 @@ export default class extends Controller { } get isHeadIntersecting() { - return this.headTarget.getBoundingClientRect().top > this.stickyTopOffset + const headRect = this.headTarget.getBoundingClientRect(); + + return headRect.bottom > this.stickyTopOffset } get isTableIntersecting() { @@ -118,7 +120,8 @@ export default class extends Controller { get stickyTopOffset() { this.prepare() - const top = window.getComputedStyle(this.stickyHeader).top + const style = window.getComputedStyle(this.stickyHeader) + const top = style.getPropertyValue('inset-block-start') || style.top return top === "auto" ? 0 : parseFloat(top) } } -- 2.50.1 (Apple Git-155)