From 5f5bf61f7a1432989c62b565f70c24c9237d725c Mon Sep 17 00:00:00 2001 From: Taranveer Virk Date: Mon, 20 Apr 2020 17:19:11 -0400 Subject: [PATCH] fix(table): change thead to sticky position with z-index (#5887) * fix(table): change thead to sticky position with z-index This change makes `thead` stick to the top of the table container and ensures the elements in `thead` are visible as the table body is scrolled. * fix(data-table): remove padding as we switch to sticky position Co-authored-by: TJ Egan --- .../src/components/data-table/_data-table-core.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/components/src/components/data-table/_data-table-core.scss b/packages/components/src/components/data-table/_data-table-core.scss index 12071d50c6f1..115bc404affd 100644 --- a/packages/components/src/components/data-table/_data-table-core.scss +++ b/packages/components/src/components/data-table/_data-table-core.scss @@ -474,7 +474,6 @@ // ------------- .#{$prefix}--data-table_inner-container { background-color: $ui-03; - padding-top: rem(48px); transform: translateZ(0); } @@ -492,7 +491,8 @@ } thead { - position: fixed; + position: sticky; + z-index: 1; top: 0; width: 100%; overflow: scroll;