File tree 1 file changed +19
-2
lines changed
1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change 1125
1125
* Since the focus event doesn't include key press information we can't use it
1126
1126
* as our primary source of the event.
1127
1127
*/
1128
- $elm . on ( 'mousedown' , function ( evt ) {
1128
+ $elm . on ( 'mousedown' , preventMouseDown ) ;
1129
+
1130
+ //turn on and off for edit events
1131
+ if ( uiGridCtrl . grid . api . edit ) {
1132
+ uiGridCtrl . grid . api . edit . on . beginCellEdit ( $scope , function ( ) {
1133
+ $elm . off ( 'mousedown' , preventMouseDown ) ;
1134
+ } ) ;
1135
+
1136
+ uiGridCtrl . grid . api . edit . on . afterCellEdit ( $scope , function ( ) {
1137
+ $elm . on ( 'mousedown' , preventMouseDown ) ;
1138
+ } ) ;
1139
+
1140
+ uiGridCtrl . grid . api . edit . on . cancelCellEdit ( $scope , function ( ) {
1141
+ $elm . on ( 'mousedown' , preventMouseDown ) ;
1142
+ } ) ;
1143
+ }
1144
+
1145
+ function preventMouseDown ( evt ) {
1129
1146
//Prevents the foucus event from firing if the click event is already going to fire.
1130
1147
//If both events fire it will cause bouncing behavior.
1131
1148
evt . preventDefault ( ) ;
1132
- } ) ;
1149
+ }
1133
1150
1134
1151
//You can only focus on elements with a tabindex value
1135
1152
$elm . on ( 'focus' , function ( evt ) {
You can’t perform that action at this time.
0 commit comments