@@ -42,11 +42,6 @@ export const columnOffsetAtIndexWhileReordering = stripVar(
4242 InternalVars . columnOffsetAtIndexWhileReordering ,
4343) ;
4444
45- const SCROLLING_OBJECT_PARAM_FLYWEIGHT = {
46- scrolling : false ,
47- isHorizontalLayout : false ,
48- } ;
49-
5045export class GridRenderer extends Logger {
5146 protected brain : MatrixBrain ;
5247
@@ -1381,15 +1376,11 @@ export class GridRenderer extends Logger {
13811376
13821377 return ;
13831378 }
1384- SCROLLING_OBJECT_PARAM_FLYWEIGHT . scrolling = this . scrolling ;
1385- SCROLLING_OBJECT_PARAM_FLYWEIGHT . isHorizontalLayout = isHorizontalLayout ;
1386-
13871379 this . cellManager . renderNodeAtCell (
13881380 renderedNode ,
13891381 cell ,
13901382 [ rowIndex , colIndex ] ,
13911383 cellAdditionalInfo ,
1392- SCROLLING_OBJECT_PARAM_FLYWEIGHT ,
13931384 ) ;
13941385
13951386 this . updateElementPosition ( cell , { hidden, rowspan, colspan } ) ;
@@ -1501,45 +1492,53 @@ export class GridRenderer extends Logger {
15011492 const { x, y } = itemPosition ;
15021493
15031494 if ( itemElement ) {
1504- this . updateHoverClassNamesForRow ( rowIndex ) ;
1505-
1506- // itemElement.style.gridColumn = `${colIndex} / span 1`;
1507- // itemElement.style.gridRow = `${rowIndex} / span 1`;
1508-
1509- // (itemElement.dataset as any).elementIndex = elementIndex;
1510- const realCoords = this . getCellRealCoordinates ( rowIndex , colIndex ) ;
1511- ( itemElement . dataset as any ) . rowIndex = realCoords . rowIndex ;
1495+ const applyPosition = ( ) => {
1496+ this . updateHoverClassNamesForRow ( rowIndex ) ;
1497+ // itemElement.style.gridColumn = `${colIndex} / span 1`;
1498+ // itemElement.style.gridRow = `${rowIndex} / span 1`;
1499+
1500+ // (itemElement.dataset as any).elementIndex = elementIndex;
1501+ const realCoords = this . getCellRealCoordinates ( rowIndex , colIndex ) ;
1502+ ( itemElement . dataset as any ) . rowIndex = realCoords . rowIndex ;
1503+
1504+ ( itemElement . dataset as any ) . colIndex = realCoords . colIndex ;
1505+
1506+ if ( ITEM_POSITION_WITH_TRANSFORM ) {
1507+ this . setTransform ( itemElement , rowIndex , colIndex , { x, y } , null ) ;
1508+
1509+ itemElement . style . willChange = 'transform' ;
1510+ itemElement . style . backfaceVisibility = 'hidden' ;
1511+ // need to set it to auto
1512+ // in case some fixed cells are reused
1513+ // as the fixed cells had a zIndex
1514+ const hidden = options
1515+ ? options . hidden
1516+ : ! ! this . isCellCovered ( rowIndex , colIndex ) ;
1517+
1518+ const zIndex = hidden
1519+ ? '-1'
1520+ : // #updatezindex - we need to allow elements use their own zIndex, so we
1521+ // resort to allowing them to have it as a data-z-index attribute
1522+ itemElement . dataset . zIndex || 'auto' ;
15121523
1513- ( itemElement . dataset as any ) . colIndex = realCoords . colIndex ;
1514-
1515- if ( ITEM_POSITION_WITH_TRANSFORM ) {
1516- this . setTransform ( itemElement , rowIndex , colIndex , { x, y } , null ) ;
1517-
1518- itemElement . style . willChange = 'transform' ;
1519- itemElement . style . backfaceVisibility = 'hidden' ;
1520- // need to set it to auto
1521- // in case some fixed cells are reused
1522- // as the fixed cells had a zIndex
1523- const hidden = options
1524- ? options . hidden
1525- : ! ! this . isCellCovered ( rowIndex , colIndex ) ;
1526-
1527- const zIndex = hidden
1528- ? '-1'
1529- : // #updatezindex - we need to allow elements use their own zIndex, so we
1530- // resort to allowing them to have it as a data-z-index attribute
1531- itemElement . dataset . zIndex || 'auto' ;
1532-
1533- //@ts -ignore
1534- if ( itemElement . __zIndex !== zIndex ) {
15351524 //@ts -ignore
1536- itemElement . __zIndex = zIndex ;
1537- itemElement . style . zIndex = zIndex ;
1525+ if ( itemElement . __zIndex !== zIndex ) {
1526+ //@ts -ignore
1527+ itemElement . __zIndex = zIndex ;
1528+ itemElement . style . zIndex = zIndex ;
1529+ }
1530+ } else {
1531+ itemElement . style . display = '' ;
1532+ itemElement . style . left = `${ x } px` ;
1533+ itemElement . style . top = `${ y } px` ;
15381534 }
1535+ } ;
1536+
1537+ // if (this.scrolling && this.brain.isHorizontalLayoutBrain) {
1538+ if ( this . scrolling && this . brain . isHorizontalLayoutBrain ) {
1539+ cell . setPendingAfterCommitWork ( applyPosition ) ;
15391540 } else {
1540- itemElement . style . display = '' ;
1541- itemElement . style . left = `${ x } px` ;
1542- itemElement . style . top = `${ y } px` ;
1541+ applyPosition ( ) ;
15431542 }
15441543 }
15451544 } ;
0 commit comments