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 11<Project Sdk =" Microsoft.NET.Sdk.Razor" >
22
33 <PropertyGroup >
4- <Version >9.5.6-beta05 </Version >
4+ <Version >9.5.6</Version >
55 </PropertyGroup >
66
77 <ItemGroup >
Original file line number Diff line number Diff line change @@ -389,15 +389,19 @@ const setExcelKeyboardListener = table => {
389389 const setFocus = target => {
390390 const handler = setTimeout ( function ( ) {
391391 clearTimeout ( handler ) ;
392- target . focus ( ) ;
393- target . select ( ) ;
392+ if ( target . focus ) {
393+ target . focus ( ) ;
394+ }
395+ if ( target . select ) {
396+ target . select ( ) ;
397+ }
394398 } , 10 ) ;
395399 }
396400
397401 const activeCell = ( cells , index ) => {
398402 let ret = false ;
399403 const td = cells [ index ] ;
400- const target = td . querySelector ( 'input .form-control:not([readonly])' ) ;
404+ const target = td . querySelector ( '.form-control:not([readonly])' ) ;
401405 if ( target ) {
402406 setFocus ( target ) ;
403407 ret = true ;
@@ -425,22 +429,30 @@ const setExcelKeyboardListener = table => {
425429 }
426430 }
427431 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 ) {
431436 if ( activeCell ( cells , index ) ) {
432437 break ;
433438 }
439+ else {
440+ nextRow = nextRow . previousElementSibling ;
441+ }
434442 }
435443 }
436444 }
437445 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 ) {
441450 if ( activeCell ( cells , index ) ) {
442451 break ;
443452 }
453+ else {
454+ nextRow = nextRow . nextElementSibling ;
455+ }
444456 }
445457 }
446458 }
You can’t perform that action at this time.
0 commit comments