@@ -508,6 +508,80 @@ test('Horizontal scrolling should work correctly in RTL mode with native scrolli
508508 await removeStylesheetRulesFromPage ( ) ;
509509} ) ;
510510
511+ test ( 'Column headers should keep the scroll position after resizing a column in RTL mode with native scrolling' , async ( t ) => {
512+ const dataGrid = new DataGrid ( '#container' ) ;
513+ const rowsScrollContainer = dataGrid . getScrollContainer ( ) ;
514+ const headersScrollContainer = dataGrid . getHeadersScrollContainer ( ) ;
515+
516+ await t
517+ . expect ( dataGrid . isReady ( ) )
518+ . ok ( ) ;
519+
520+ const initialScrollLeft = await dataGrid . getScrollLeft ( ) ;
521+
522+ await dataGrid . scrollTo ( t , { x : initialScrollLeft - 100 } ) ;
523+
524+ await t
525+ . expect ( rowsScrollContainer . scrollLeft )
526+ . eql ( - 100 )
527+ . expect ( headersScrollContainer . scrollLeft )
528+ . eql ( - 100 ) ;
529+
530+ await dataGrid . resizeHeader ( 2 , - 30 ) ;
531+
532+ await t
533+ . expect ( rowsScrollContainer . scrollLeft )
534+ . eql ( - 100 )
535+ . expect ( headersScrollContainer . scrollLeft )
536+ . eql ( - 100 ) ;
537+ } ) . before ( async ( ) => createWidget ( 'dxDataGrid' , {
538+ rtlEnabled : true ,
539+ width : 500 ,
540+ dataSource : getData ( 5 , 10 ) ,
541+ columnAutoWidth : true ,
542+ allowColumnResizing : true ,
543+ columnResizingMode : 'nextColumn' ,
544+ scrolling : {
545+ useNative : true ,
546+ } ,
547+ } ) ) ;
548+
549+ test ( 'Column headers should keep the scroll position after repaint in RTL mode with native scrolling' , async ( t ) => {
550+ const dataGrid = new DataGrid ( '#container' ) ;
551+ const rowsScrollContainer = dataGrid . getScrollContainer ( ) ;
552+ const headersScrollContainer = dataGrid . getHeadersScrollContainer ( ) ;
553+
554+ await t
555+ . expect ( dataGrid . isReady ( ) )
556+ . ok ( ) ;
557+
558+ const initialScrollLeft = await dataGrid . getScrollLeft ( ) ;
559+
560+ await dataGrid . scrollTo ( t , { x : initialScrollLeft - 100 } ) ;
561+
562+ await t
563+ . expect ( rowsScrollContainer . scrollLeft )
564+ . eql ( - 100 )
565+ . expect ( headersScrollContainer . scrollLeft )
566+ . eql ( - 100 ) ;
567+
568+ await dataGrid . repaint ( ) ;
569+
570+ await t
571+ . expect ( rowsScrollContainer . scrollLeft )
572+ . eql ( - 100 )
573+ . expect ( headersScrollContainer . scrollLeft )
574+ . eql ( - 100 ) ;
575+ } ) . before ( async ( ) => createWidget ( 'dxDataGrid' , {
576+ rtlEnabled : true ,
577+ width : 500 ,
578+ dataSource : getData ( 5 , 10 ) ,
579+ columnAutoWidth : true ,
580+ scrolling : {
581+ useNative : true ,
582+ } ,
583+ } ) ) ;
584+
511585test ( 'Column headers should have the correct scroll position after refreshing the data twice when RTL and virtual scrolling are enabled (T1333941)' , async ( t ) => {
512586 const dataGrid = new DataGrid ( '#container' ) ;
513587
0 commit comments