@@ -333,7 +333,6 @@ export default class CellManager {
333333
334334 _selectArea ( $cell1 , $cell2 ) {
335335 if ( $cell1 === $cell2 ) return false ;
336-
337336 const cells = this . getCellsInRange ( $cell1 , $cell2 ) ;
338337 if ( ! cells ) return false ;
339338
@@ -346,7 +345,7 @@ export default class CellManager {
346345 }
347346
348347 getCellsInRange ( $cell1 , $cell2 ) {
349- let colIndex1 , rowIndex1 , colIndex2 , rowIndex2 ;
348+ let colIndex1 , rowIndex1 , colIndex2 , rowIndex2 , sortedColumns ;
350349
351350 if ( typeof $cell1 === 'number' ) {
352351 [ colIndex1 , rowIndex1 , colIndex2 , rowIndex2 ] = arguments ;
@@ -360,9 +359,18 @@ export default class CellManager {
360359 const cell2 = $ . data ( $cell2 ) ;
361360
362361 colIndex1 = + cell1 . colIndex ;
363- rowIndex1 = + cell1 . rowIndex ;
364362 colIndex2 = + cell2 . colIndex ;
365- rowIndex2 = + cell2 . rowIndex ;
363+ if ( this . datamanager . getColumn ( colIndex1 ) . sortOrder != "none" || this . datamanager . getColumn ( colIndex2 ) . sortOrder != "none" ) {
364+ sortedColumns = true ;
365+ rowIndex1 = this . datamanager . rowViewOrder . indexOf ( parseInt ( cell1 . rowIndex ) )
366+ rowIndex2 = this . datamanager . rowViewOrder . indexOf ( parseInt ( cell2 . rowIndex ) )
367+ } else {
368+ rowIndex1 = + cell1 . rowIndex ;
369+ rowIndex2 = + cell2 . rowIndex ;
370+ }
371+
372+
373+
366374 }
367375
368376 if ( rowIndex1 > rowIndex2 ) {
@@ -394,7 +402,9 @@ export default class CellManager {
394402 }
395403 colIndex = colIndex1 ;
396404 } ) ;
397-
405+ if ( sortedColumns ) {
406+ cells . map ( selectedCells => selectedCells [ 1 ] = this . datamanager . rowViewOrder [ selectedCells [ 1 ] ] )
407+ }
398408 return cells ;
399409 }
400410
0 commit comments