File tree Expand file tree Collapse file tree 2 files changed +22
-10
lines changed Expand file tree Collapse file tree 2 files changed +22
-10
lines changed Original file line number Diff line number Diff line change 1
1
<Project Sdk =" Microsoft.NET.Sdk.Razor" >
2
2
3
3
<PropertyGroup >
4
- <Version >9.5.6-beta05 </Version >
4
+ <Version >9.5.6</Version >
5
5
</PropertyGroup >
6
6
7
7
<ItemGroup >
Original file line number Diff line number Diff line change @@ -389,15 +389,19 @@ const setExcelKeyboardListener = table => {
389
389
const setFocus = target => {
390
390
const handler = setTimeout ( function ( ) {
391
391
clearTimeout ( handler ) ;
392
- target . focus ( ) ;
393
- target . select ( ) ;
392
+ if ( target . focus ) {
393
+ target . focus ( ) ;
394
+ }
395
+ if ( target . select ) {
396
+ target . select ( ) ;
397
+ }
394
398
} , 10 ) ;
395
399
}
396
400
397
401
const activeCell = ( cells , index ) => {
398
402
let ret = false ;
399
403
const td = cells [ index ] ;
400
- const target = td . querySelector ( 'input .form-control:not([readonly])' ) ;
404
+ const target = td . querySelector ( '.form-control:not([readonly])' ) ;
401
405
if ( target ) {
402
406
setFocus ( target ) ;
403
407
ret = true ;
@@ -425,22 +429,30 @@ const setExcelKeyboardListener = table => {
425
429
}
426
430
}
427
431
else if ( keyCode === KeyCodes . UP_ARROW ) {
428
- cells = tr . previousElementSibling && tr . previousElementSibling . children ;
429
- if ( cells ) {
430
- while ( index < cells . length ) {
432
+ let nextRow = tr . previousElementSibling ;
433
+ while ( nextRow ) {
434
+ cells = nextRow . children ;
435
+ if ( cells ) {
431
436
if ( activeCell ( cells , index ) ) {
432
437
break ;
433
438
}
439
+ else {
440
+ nextRow = nextRow . previousElementSibling ;
441
+ }
434
442
}
435
443
}
436
444
}
437
445
else if ( keyCode === KeyCodes . DOWN_ARROW ) {
438
- cells = tr . nextElementSibling && tr . nextElementSibling . children ;
439
- if ( cells ) {
440
- while ( index < cells . length ) {
446
+ let nextRow = tr . nextElementSibling ;
447
+ while ( nextRow ) {
448
+ cells = nextRow . children ;
449
+ if ( cells ) {
441
450
if ( activeCell ( cells , index ) ) {
442
451
break ;
443
452
}
453
+ else {
454
+ nextRow = nextRow . nextElementSibling ;
455
+ }
444
456
}
445
457
}
446
458
}
You can’t perform that action at this time.
0 commit comments