@@ -319,6 +319,62 @@ QUnit.module('keyboard navigation', {
319319 assert . deepEqual ( list . option ( 'items' ) , items , 'items were reordered' ) ;
320320 } ) ;
321321
322+ QUnit . test ( 'shift+arrowUp on first item should not throw error (T1320189)' , function ( assert ) {
323+ const items = [ '1' , '2' , '3' ] ;
324+
325+ const $list = $ ( '#list' ) . dxList ( {
326+ items : items ,
327+ editEnabled : true ,
328+ itemDragging : {
329+ allowReordering : true
330+ } ,
331+ focusStateEnabled : true
332+ } ) ;
333+
334+ const list = $list . dxList ( 'instance' ) ;
335+ const keyboard = keyboardMock ( $list . find ( '[tabindex=0]' ) ) ;
336+
337+ const $firstItem = $list . find ( '.' + LIST_ITEM_CLASS ) . eq ( 0 ) ;
338+ list . option ( 'focusedElement' , $firstItem . get ( 0 ) ) ;
339+
340+ let errorMessage = '' ;
341+ try {
342+ keyboard . keyDown ( 'arrowUp' , { shiftKey : true } ) ;
343+ } catch ( e ) {
344+ errorMessage = `error message: ${ e . message } ` ;
345+ }
346+
347+ assert . strictEqual ( errorMessage , '' , 'no error thrown when trying to move first item up' ) ;
348+ } ) ;
349+
350+ QUnit . test ( 'shift+arrowDown on last item should not throw error (T1320189)' , function ( assert ) {
351+ const items = [ '1' , '2' , '3' ] ;
352+
353+ const $list = $ ( '#list' ) . dxList ( {
354+ items : items ,
355+ editEnabled : true ,
356+ itemDragging : {
357+ allowReordering : true
358+ } ,
359+ focusStateEnabled : true
360+ } ) ;
361+ const list = $list . dxList ( 'instance' ) ;
362+ const keyboard = keyboardMock ( $list . find ( '[tabindex=0]' ) ) ;
363+
364+ const $lastItem = $list . find ( '.' + LIST_ITEM_CLASS ) . eq ( 2 ) ;
365+ list . option ( 'focusedElement' , $lastItem . get ( 0 ) ) ;
366+
367+ let errorMessage = '' ;
368+ try {
369+ keyboard . keyDown ( 'arrowDown' , { shiftKey : true } ) ;
370+ } catch ( e ) {
371+ errorMessage = `error message: ${ e . message } ` ;
372+ }
373+
374+ assert . strictEqual ( errorMessage , '' , 'no error thrown when trying to move last item down' ) ;
375+ } ) ;
376+
377+
322378 QUnit . module ( 'grouped' , {
323379 beforeEach : function ( ) {
324380 this . getInitialItems = ( ) => {
0 commit comments