@@ -196,6 +196,58 @@ describe('listTable init test', () => {
196196 ] ) ;
197197 expect ( listTable . getScrollTop ( ) ) . toBe ( scrollTop ) ;
198198 } ) ;
199+ test ( 'listTable drag select should stop before disabled merged last row' , ( ) => {
200+ const dragContainerDom : HTMLElement = createDiv ( ) ;
201+ dragContainerDom . style . position = 'relative' ;
202+ dragContainerDom . style . width = '800px' ;
203+ dragContainerDom . style . height = '600px' ;
204+ const dragRecords = [
205+ { a : 'r1' , b : 1 , c : 'x' } ,
206+ { a : 'r2' , b : 2 , c : 'y' } ,
207+ { a : 'r3' , b : 3 , c : 'z' } ,
208+ { a : 'r4' , b : 4 , c : 'w' }
209+ ] ;
210+ const dragTable = new ListTable ( {
211+ container : dragContainerDom ,
212+ columns : [
213+ { field : 'a' , title : 'A' , width : 120 } ,
214+ { field : 'b' , title : 'B' , width : 120 } ,
215+ { field : 'c' , title : 'C' , width : 120 }
216+ ] ,
217+ records : dragRecords ,
218+ bottomFrozenRowCount : 1 ,
219+ select : {
220+ disableSelect : ( col , row , table ) => row === table . rowCount - 1
221+ } ,
222+ customMergeCell : ( col , row , table ) => {
223+ if ( row === table . rowCount - 1 ) {
224+ return {
225+ text : 'summary' ,
226+ range : {
227+ start : { col : 0 , row : table . rowCount - 1 } ,
228+ end : { col : table . colCount - 1 , row : table . rowCount - 1 }
229+ }
230+ } ;
231+ }
232+ }
233+ } ) ;
234+
235+ dragTable . stateManager . updateSelectPos ( 1 , 2 , false , false , false , false , false ) ;
236+ dragTable . stateManager . updateInteractionState ( 'grabing' ) ;
237+ dragTable . stateManager . updateSelectPos ( 1 , dragTable . rowCount - 2 , false , false , false , false , false ) ;
238+ dragTable . stateManager . updateSelectPos ( 1 , dragTable . rowCount - 1 , false , false , false , false , false ) ;
239+ dragTable . stateManager . endSelectCells ( false , false ) ;
240+ dragTable . stateManager . updateInteractionState ( 'default' ) ;
241+
242+ expect ( dragTable . getSelectedCellRanges ( ) ) . toEqual ( [
243+ {
244+ start : { col : 1 , row : 2 } ,
245+ end : { col : 1 , row : dragTable . rowCount - 2 }
246+ }
247+ ] ) ;
248+
249+ dragTable . release ( ) ;
250+ } ) ;
199251 test ( 'listTable measureTextWidth' , ( ) => {
200252 const measureTextWdith = listTable . measureText ( "家里方大化工撒个福建师大看哈 fdsfgj! *-+&5%#.,'.,。、" , {
201253 fontFamily : 'Arial' ,
0 commit comments