@@ -5860,11 +5860,20 @@ export class SlickGrid<TData = any, C extends Column<TData> = Column<TData>, O e
5860
5860
//////////////////////////////////////////////////////////////////////////////////////////////
5861
5861
// Cell switching
5862
5862
5863
- /** Resets active cell. */
5863
+ /** Resets active cell by making cell normal and other internal resets . */
5864
5864
resetActiveCell ( ) {
5865
5865
this . setActiveCellInternal ( null , false ) ;
5866
5866
}
5867
5867
5868
+ /** Clear active cell by making cell normal & removing "active" CSS class. */
5869
+ unsetActiveCell ( ) {
5870
+ if ( Utils . isDefined ( this . activeCellNode ) ) {
5871
+ this . makeActiveCellNormal ( ) ;
5872
+ this . activeCellNode . classList . remove ( 'active' ) ;
5873
+ this . rowsCache [ this . activeRow ] ?. rowNode ?. forEach ( ( node ) => node . classList . remove ( 'active' ) ) ;
5874
+ }
5875
+ }
5876
+
5868
5877
/** @alias `setFocus` */
5869
5878
focus ( ) {
5870
5879
this . setFocus ( ) ;
@@ -5913,11 +5922,8 @@ export class SlickGrid<TData = any, C extends Column<TData> = Column<TData>, O e
5913
5922
}
5914
5923
5915
5924
protected setActiveCellInternal ( newCell : HTMLDivElement | null , opt_editMode ?: boolean | null , preClickModeOn ?: boolean | null , suppressActiveCellChangedEvent ?: boolean , e ?: Event | SlickEvent_ ) {
5916
- if ( Utils . isDefined ( this . activeCellNode ) ) {
5917
- this . makeActiveCellNormal ( ) ;
5918
- this . activeCellNode . classList . remove ( 'active' ) ;
5919
- this . rowsCache [ this . activeRow ] ?. rowNode ?. forEach ( ( node ) => node . classList . remove ( 'active' ) ) ;
5920
- }
5925
+ // make current active cell as normal cell & remove "active" CSS classes
5926
+ this . unsetActiveCell ( ) ;
5921
5927
5922
5928
// let activeCellChanged = (this.activeCellNode !== newCell);
5923
5929
this . activeCellNode = newCell ;
@@ -6350,11 +6356,13 @@ export class SlickGrid<TData = any, C extends Column<TData> = Column<TData>, O e
6350
6356
6351
6357
/** Navigate to the top of the grid */
6352
6358
navigateTop ( ) {
6359
+ this . unsetActiveCell ( ) ;
6353
6360
this . navigateToRow ( 0 ) ;
6354
6361
}
6355
6362
6356
6363
/** Navigate to the bottom of the grid */
6357
6364
navigateBottom ( ) {
6365
+ this . unsetActiveCell ( ) ;
6358
6366
this . navigateToRow ( this . getDataLength ( ) - 1 ) ;
6359
6367
}
6360
6368
@@ -6689,6 +6697,7 @@ export class SlickGrid<TData = any, C extends Column<TData> = Column<TData>, O e
6689
6697
return true ;
6690
6698
}
6691
6699
this . setFocus ( ) ;
6700
+ this . unsetActiveCell ( ) ;
6692
6701
6693
6702
const tabbingDirections = {
6694
6703
'up' : - 1 ,
0 commit comments