@@ -279,7 +279,7 @@ export function getColumnIndexForX(
279
279
const colIdx = effectiveColumns . length - 1 - fc ;
280
280
const col = effectiveColumns [ colIdx ] ;
281
281
y -= col . width ;
282
- if ( targetX < = y ) {
282
+ if ( targetX > = y ) {
283
283
return col . sourceIndex ;
284
284
}
285
285
}
@@ -810,24 +810,30 @@ export function computeBounds(
810
810
811
811
const freezeLeftColumns = typeof freezeColumns === "number" ? freezeColumns : freezeColumns [ 0 ] ;
812
812
const freezeRightColumns = typeof freezeColumns === "number" ? 0 : freezeColumns [ 1 ] ;
813
+ const column = mappedColumns [ col ] ;
813
814
814
815
if ( col >= mappedColumns . length || row >= rows || row < - 2 || col < 0 ) {
815
816
return result ;
816
817
}
817
818
818
819
const headerHeight = totalHeaderHeight - groupHeaderHeight ;
819
820
820
- if ( col >= freezeLeftColumns ) {
821
+ if ( col >= freezeLeftColumns && col < mappedColumns . length - freezeRightColumns ) {
821
822
const dir = cellXOffset > col ? - 1 : 1 ;
822
- const [ freezeLeftWidth , freezeRightWidth ] = getStickyWidth ( mappedColumns ) ;
823
+ const [ freezeLeftWidth ] = getStickyWidth ( mappedColumns ) ;
823
824
result . x += freezeLeftWidth + translateX ;
824
825
for ( let i = cellXOffset ; i !== col ; i += dir ) {
825
826
result . x += mappedColumns [ dir === 1 ? i : i - 1 ] . width * dir ;
826
827
}
827
- } else {
828
+ } else if ( column . stickyPosition === "left" ) {
828
829
for ( let i = 0 ; i < col ; i ++ ) {
829
830
result . x += mappedColumns [ i ] . width ;
830
831
}
832
+ } else if ( column . stickyPosition === "right" ) {
833
+ result . x = width ;
834
+ for ( let i = col ; i < mappedColumns . length ; i ++ ) {
835
+ result . x -= mappedColumns [ i ] . width ;
836
+ }
831
837
}
832
838
result . width = mappedColumns [ col ] . width + 1 ;
833
839
@@ -863,7 +869,7 @@ export function computeBounds(
863
869
end ++ ;
864
870
}
865
871
if ( ! sticky ) {
866
- const [ freezeLeftWidth , freezeRightWidth ] = getStickyWidth ( mappedColumns ) ;
872
+ const [ freezeLeftWidth ] = getStickyWidth ( mappedColumns ) ;
867
873
const clip = result . x - freezeLeftWidth ;
868
874
if ( clip < 0 ) {
869
875
result . x -= clip ;
0 commit comments