File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed
Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -248,7 +248,7 @@ export const DragAndDropMixin = (superClass) =>
248248 let row = e . composedPath ( ) . find ( ( node ) => node . localName === 'tr' ) ;
249249
250250 // Update the horizontal scroll position property of the row being dragged over
251- // this.__updateRowScrollPositionProperty(row);
251+ this . __updateRowScrollPositionProperty ( row ) ;
252252
253253 if ( ! this . _flatSize || this . dropMode === DropMode . ON_GRID ) {
254254 // The grid is empty or "on-grid" drop mode was used, always default to "empty"
Original file line number Diff line number Diff line change @@ -449,7 +449,26 @@ export const ScrollMixin = (superClass) =>
449449 }
450450 } ) ;
451451
452- this . $ . table . style . setProperty ( '--_grid-horizontal-scroll-position' , `${ this . __horizontalScrollPosition } px` ) ;
452+ const focusedRow = this . shadowRoot . querySelector ( "[part~='row']:focus" ) ;
453+ if ( focusedRow ) {
454+ // Update the horizontal scroll position property of the focused row
455+ this . __updateRowScrollPositionProperty ( focusedRow ) ;
456+ }
457+ }
458+
459+ /**
460+ * Synchronizes the internal `--_grid-horizontal-scroll-position` CSS property
461+ * of the given row with the current horizontal scroll position of the grid.
462+ * @private
463+ */
464+ __updateRowScrollPositionProperty ( row ) {
465+ if ( row instanceof HTMLTableRowElement === false ) {
466+ return ;
467+ }
468+ const newValue = `${ this . __horizontalScrollPosition } px` ;
469+ if ( row . style . getPropertyValue ( '--_grid-horizontal-scroll-position' ) !== newValue ) {
470+ row . style . setProperty ( '--_grid-horizontal-scroll-position' , newValue ) ;
471+ }
453472 }
454473
455474 /** @private */
You can’t perform that action at this time.
0 commit comments