From 2c07814fc232a12c1a2c861bacebb8053fb280ee Mon Sep 17 00:00:00 2001 From: Kimo Knowles Date: Fri, 4 Oct 2024 01:31:30 +0200 Subject: [PATCH] Fix row-label sticky top position --- src/re_com/nested_grid.cljs | 4 ++-- src/re_com/theme/default.cljs | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/re_com/nested_grid.cljs b/src/re_com/nested_grid.cljs index 5fdcb0ce..9ab34b0a 100644 --- a/src/re_com/nested_grid.cljs +++ b/src/re_com/nested_grid.cljs @@ -966,8 +966,8 @@ :header-spec (last path) :show? show? :sticky? sticky? - :column-header-total-height - column-header-total-height} + :sticky-top (cond-> column-header-total-height + (and sticky? show-export-button?) (+ 25))} theme (update theme :user-variables conj (theme/with-state state)) props (merge {:theme theme diff --git a/src/re_com/theme/default.cljs b/src/re_com/theme/default.cljs index 0f5f1b5d..4d95f0ab 100644 --- a/src/re_com/theme/default.cljs +++ b/src/re_com/theme/default.cljs @@ -89,14 +89,12 @@ :height "100%"})) (defmethod base ::nested-grid/row-header - [props {{:keys [sticky? column-header-total-height]} :state}] + [props {{:keys [sticky? sticky-top]} :state}] (update props :style merge {:width "100%" :text-overflow :ellipsis :overflow :hidden :position :sticky - :top column-header-total-height} - (when sticky? {:position :sticky - :top (+ 25 column-header-total-height)}))) + :top sticky-top})) (defmethod base ::nested-grid/column-header [props {{:keys [sticky? row-header-total-width]} :state}]