@@ -709,12 +709,22 @@ class BootstrapTable extends Component {
709
709
handleNavigateCell = ( { x : offSetX , y : offSetY , lastEditCell } ) => {
710
710
const { pagination } = this . props ;
711
711
let { x, y, currPage } = this . state ;
712
- x += offSetX ;
713
- y += offSetY ;
714
712
715
713
const columns = this . store . getColInfos ( ) ;
714
+ const visibleColumnIndices = Object . keys ( columns ) . map ( ( k , index ) => columns [ k ] . hidden ? - 1 : index ) . filter ( k => k !== - 1 ) ;
715
+
716
+ if ( visibleColumnIndices . indexOf ( x ) === 0 && offSetX < 0 ) {
717
+ x = - 1 ;
718
+ } else if ( ( visibleColumnIndices . indexOf ( x ) === ( visibleColumnIndices . length - 1 ) && offSetX >= 1 ) ) {
719
+ x = Object . keys ( columns ) . length ;
720
+ } else {
721
+ x = visibleColumnIndices [ visibleColumnIndices . indexOf ( x ) + offSetX ] ;
722
+ }
723
+ y += offSetY ;
724
+
716
725
const visibleRowSize = this . state . data . length ;
717
726
const visibleColumnSize = Object . keys ( columns ) . filter ( k => ! columns [ k ] . hidden ) . length ;
727
+ const hiddenColumnSize = Object . keys ( columns ) . filter ( k => columns [ k ] . hidden ) . length ;
718
728
719
729
if ( y >= visibleRowSize ) {
720
730
currPage ++ ;
@@ -733,7 +743,7 @@ class BootstrapTable extends Component {
733
743
return ;
734
744
}
735
745
y = visibleRowSize - 1 ;
736
- } else if ( x >= visibleColumnSize ) {
746
+ } else if ( x - hiddenColumnSize >= visibleColumnSize ) {
737
747
if ( ( y + 1 ) === visibleRowSize ) {
738
748
currPage ++ ;
739
749
const lastPage = pagination ? this . pagination . getLastPage ( ) : - 1 ;
@@ -746,9 +756,9 @@ class BootstrapTable extends Component {
746
756
} else {
747
757
y ++ ;
748
758
}
749
- x = lastEditCell ? 1 : 0 ;
759
+ x = lastEditCell ? visibleColumnIndices [ 1 ] : visibleColumnIndices [ 0 ] ;
750
760
} else if ( x < 0 ) {
751
- x = visibleColumnSize - 1 ;
761
+ x = visibleColumnIndices [ visibleColumnIndices . length - 1 ] ;
752
762
if ( y === 0 ) {
753
763
currPage -- ;
754
764
if ( currPage > 0 ) {
0 commit comments