@@ -303,7 +303,8 @@ describe('IgxGrid - multi-column headers #grid', () => {
303303 grid . ngAfterViewInit ( ) ;
304304
305305
306- const availableWidth = ( parseInt ( componentInstance . gridWrapperWidthPx , 10 ) - grid . scrollWidth ) . toString ( ) ;
306+ const scrWitdh = grid . nativeElement . querySelector ( '.igx-grid__tbody-scrollbar' ) . getBoundingClientRect ( ) . width ;
307+ const availableWidth = ( parseInt ( componentInstance . gridWrapperWidthPx , 10 ) - scrWitdh ) . toString ( ) ;
307308 const locationColGroup = getColGroup ( grid , 'Location' ) ;
308309 const colWidth = Math . round ( parseInt ( availableWidth , 10 ) / 3 ) ;
309310 const colWidthPx = colWidth + 'px' ;
@@ -326,7 +327,8 @@ describe('IgxGrid - multi-column headers #grid', () => {
326327 grid . width = gridWidth ;
327328 tick ( ) ;
328329 fixture . detectChanges ( ) ;
329- const gridWidthInPx = parseInt ( gridWidth , 10 ) - grid . scrollWidth ;
330+ const scrWitdh = grid . nativeElement . querySelector ( '.igx-grid__tbody-scrollbar' ) . getBoundingClientRect ( ) . width ;
331+ const gridWidthInPx = parseInt ( gridWidth , 10 ) - scrWitdh ;
330332 const colWidth = Math . round ( gridWidthInPx / 3 ) ;
331333 const colWidthPx = colWidth + 'px' ;
332334 const locationColGroup = getColGroup ( grid , 'Location' ) ;
@@ -350,8 +352,10 @@ describe('IgxGrid - multi-column headers #grid', () => {
350352 tick ( ) ;
351353 fixture . detectChanges ( ) ;
352354
355+ const scrWitdh = grid . nativeElement . querySelector ( '.igx-grid__tbody-scrollbar' ) . getBoundingClientRect ( ) . width ;
356+
353357 const gridWidthInPx = ( parseInt ( gridWidth , 10 ) / 100 ) *
354- parseInt ( componentInstance . gridWrapperWidthPx , 10 ) - grid . scrollWidth ;
358+ parseInt ( componentInstance . gridWrapperWidthPx , 10 ) - scrWitdh ;
355359 const colWidth = Math . round ( gridWidthInPx / 3 ) ;
356360 const colWidthPx = colWidth + 'px' ;
357361 const locationColGroup = getColGroup ( grid , 'Location' ) ;
0 commit comments