File tree Expand file tree Collapse file tree 2 files changed +23
-20
lines changed Expand file tree Collapse file tree 2 files changed +23
-20
lines changed Original file line number Diff line number Diff line change @@ -161,6 +161,24 @@ export const gridStyles = css`
161161 border : var (--_row-border-width ) var (--_border-color );
162162 }
163163
164+ # header ::before ,
165+ # footer ::before {
166+ position : absolute;
167+ inset : 0 ;
168+ border-block : var (--_row-border-width ) solid var (--_border-color );
169+ transform : translateX (var (--_grid-horizontal-scroll-position ));
170+ }
171+
172+ : host ([overflow ~= 'top' ]) # table [has-header ] # header ::before {
173+ content : '' ;
174+ inset-block-end : calc (var (--_row-border-width ) * -1 );
175+ }
176+
177+ : host ([overflow ~= 'bottom' ]) # table [has-footer ] # footer ::before {
178+ content : '' ;
179+ inset-block-start : calc (var (--_row-border-width ) * -1 );
180+ }
181+
164182 [part ~= 'cell' ]: where (: not ([part ~= 'details-cell' ])) {
165183 flex-shrink : 0 ;
166184 flex-grow : 1 ;
@@ -474,6 +492,10 @@ export const gridStyles = css`
474492 inset-block-end : 0 ;
475493 }
476494
495+ # footer [part ~= 'row' ]: first-child ::after {
496+ inset-block-start : calc (var (--_row-border-width ) * -1 );
497+ }
498+
477499 : host ([navigating ]) [part ~= 'row' ]: focus,
478500 : host ([navigating ]) [part ~= 'cell' ]: focus {
479501 outline : 0 ;
Original file line number Diff line number Diff line change @@ -445,26 +445,7 @@ export const ScrollMixin = (superClass) =>
445445 }
446446 } ) ;
447447
448- const focusedRow = this . shadowRoot . querySelector ( "[part~='row']:focus" ) ;
449- if ( focusedRow ) {
450- // Update the horizontal scroll position property of the focused row
451- this . __updateRowScrollPositionProperty ( focusedRow ) ;
452- }
453- }
454-
455- /**
456- * Synchronizes the internal `--_grid-horizontal-scroll-position` CSS property
457- * of the given row with the current horizontal scroll position of the grid.
458- * @private
459- */
460- __updateRowScrollPositionProperty ( row ) {
461- if ( row instanceof HTMLTableRowElement === false ) {
462- return ;
463- }
464- const newValue = `${ this . __horizontalScrollPosition } px` ;
465- if ( row . style . getPropertyValue ( '--_grid-horizontal-scroll-position' ) !== newValue ) {
466- row . style . setProperty ( '--_grid-horizontal-scroll-position' , newValue ) ;
467- }
448+ this . $ . table . style . setProperty ( '--_grid-horizontal-scroll-position' , `${ this . __horizontalScrollPosition } px` ) ;
468449 }
469450
470451 /** @private */
You can’t perform that action at this time.
0 commit comments