@@ -1048,6 +1048,28 @@ function _moveFocusCell(
1048
1048
_invalidateRect ( this , afterRect ) ;
1049
1049
}
1050
1050
}
1051
+ function _updatedSelection ( this : DrawGrid ) : void {
1052
+ const { focusControl } = this [ _ ] ;
1053
+ const { col : selCol , row : selRow } = this [ _ ] . selection . select ;
1054
+ const results = this . fireListeners ( DG_EVENT_TYPE . EDITABLEINPUT_CELL , {
1055
+ col : selCol ,
1056
+ row : selRow
1057
+ } ) ;
1058
+
1059
+ const editMode = array . findIndex ( results , v => ! ! v ) >= 0 ;
1060
+ focusControl . editMode = editMode ;
1061
+
1062
+ if ( editMode ) {
1063
+ focusControl . storeInputStatus ( ) ;
1064
+ focusControl . setDefaultInputStatus ( ) ;
1065
+ this . fireListeners ( DG_EVENT_TYPE . MODIFY_STATUS_EDITABLEINPUT_CELL , {
1066
+ col : selCol ,
1067
+ row : selRow ,
1068
+ input : focusControl . input
1069
+ } ) ;
1070
+ }
1071
+ }
1072
+
1051
1073
function _getMouseAbstractPoint (
1052
1074
grid : DrawGrid ,
1053
1075
evt : TouchEvent | MouseEvent
@@ -2153,6 +2175,8 @@ class Selection extends EventTarget {
2153
2175
col : endCol ,
2154
2176
row : endRow
2155
2177
} ;
2178
+
2179
+ _updatedSelection . call ( this . _grid ) ;
2156
2180
} ) ;
2157
2181
}
2158
2182
get focus ( ) : CellAddress {
@@ -2168,6 +2192,8 @@ class Selection extends EventTarget {
2168
2192
const { col = 0 , row = 0 } = cell ;
2169
2193
this . _setSelectCell ( col , row ) ;
2170
2194
this . _setFocusCell ( col , row , true ) ;
2195
+
2196
+ _updatedSelection . call ( this . _grid ) ;
2171
2197
} ) ;
2172
2198
}
2173
2199
_setSelectCell ( col : number , row : number ) : void {
@@ -3141,24 +3167,7 @@ export abstract class DrawGrid extends EventTarget implements DrawGridAPI {
3141
3167
3142
3168
focusControl . setFocusRect ( this . getCellRect ( col , row ) ) ;
3143
3169
3144
- const { col : selCol , row : selRow } = this [ _ ] . selection . select ;
3145
- const results = this . fireListeners ( DG_EVENT_TYPE . EDITABLEINPUT_CELL , {
3146
- col : selCol ,
3147
- row : selRow
3148
- } ) ;
3149
-
3150
- const editMode = array . findIndex ( results , v => ! ! v ) >= 0 ;
3151
- focusControl . editMode = editMode ;
3152
-
3153
- if ( editMode ) {
3154
- focusControl . storeInputStatus ( ) ;
3155
- focusControl . setDefaultInputStatus ( ) ;
3156
- this . fireListeners ( DG_EVENT_TYPE . MODIFY_STATUS_EDITABLEINPUT_CELL , {
3157
- col : selCol ,
3158
- row : selRow ,
3159
- input : focusControl . input
3160
- } ) ;
3161
- }
3170
+ _updatedSelection . call ( this ) ;
3162
3171
}
3163
3172
/**
3164
3173
* Focus the cell.
0 commit comments