File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 966
966
} ) ;
967
967
}
968
968
969
- $elm . on ( 'blur' , function ( evt ) {
970
- $scope . stopEdit ( evt ) ;
969
+ // macOS will blur the checkbox when clicked in Safari and Firefox,
970
+ // to get around this, we disable the blur handler on mousedown,
971
+ // and then focus the checkbox and re-enable the blur handler after $timeout
972
+ $elm . on ( 'mousedown' , function ( evt ) {
973
+ if ( $elm [ 0 ] . type === 'checkbox' ) {
974
+ $elm . off ( 'blur' , $scope . stopEdit ) ;
975
+ $timeout ( function ( ) {
976
+ $elm . focus ( ) ;
977
+ $elm . on ( 'blur' , $scope . stopEdit ) ;
978
+ } ) ;
979
+ }
971
980
} ) ;
981
+
982
+ $elm . on ( 'blur' , $scope . stopEdit ) ;
972
983
} ) ;
973
984
974
985
1132
1143
//set focus at start of edit
1133
1144
$scope . $on ( uiGridEditConstants . events . BEGIN_CELL_EDIT , function ( ) {
1134
1145
$timeout ( function ( ) {
1135
- $elm [ 0 ] . focus ( ) ;
1146
+ $elm [ 0 ] . focus ( ) ;
1136
1147
} ) ;
1137
-
1148
+
1138
1149
$elm [ 0 ] . style . width = ( $elm [ 0 ] . parentElement . offsetWidth - 1 ) + 'px' ;
1139
1150
$elm . on ( 'blur' , function ( evt ) {
1140
1151
$scope . stopEdit ( evt ) ;
You can’t perform that action at this time.
0 commit comments