File tree Expand file tree Collapse file tree 2 files changed +27
-3
lines changed
e2e/testcafe-devextreme/tests/dataGrid/common/focus
packages/devextreme/js/__internal/grids/grid_core/keyboard_navigation Expand file tree Collapse file tree 2 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -298,3 +298,22 @@ test('DataGrid - FocusedRowChanged event isnt raised when the push API is used t
298298 } ,
299299 } ) ) ;
300300} ) ;
301+
302+ test ( 'DataGrid - Focused cell appearance is applied to non-editable CheckBox cells on mouse clicks (T1282082)' , async ( t ) => {
303+ const grid = new DataGrid ( GRID_SELECTOR ) ;
304+
305+ await t
306+ . click ( grid . getDataCell ( 0 , 0 ) . element )
307+ . click ( grid . getDataCell ( 0 , 1 ) . element )
308+ . click ( grid . getDataCell ( 0 , 0 ) . element )
309+ . expect ( grid . getDataCell ( 0 , 0 ) . isFocused )
310+ . notOk ( ) ;
311+ } ) . before ( async ( ) => createWidget ( 'dxDataGrid' , {
312+ dataSource : [
313+ { BoolOne : false , BoolTwo : false } ,
314+ ] ,
315+ columns : [
316+ 'BoolOne' ,
317+ 'BoolTwo' ,
318+ ] ,
319+ } ) ) ;
Original file line number Diff line number Diff line change @@ -1363,6 +1363,7 @@ export class KeyboardNavigationController extends modules.ViewController {
13631363 private _clickTargetCellHandler ( event , $cell ) {
13641364 const column = this . _getColumnByCellElement ( $cell ) ;
13651365 const isCellEditMode = this . _isCellEditMode ( ) ;
1366+ const isEditing = this . _editingController . isEditing ( ) ;
13661367
13671368 this . setCellFocusType ( ) ;
13681369
@@ -1397,14 +1398,18 @@ export class KeyboardNavigationController extends modules.ViewController {
13971398 const $target = event
13981399 && $ ( event . target ) . closest ( `${ NON_FOCUSABLE_ELEMENTS_SELECTOR } , td` ) ;
13991400 const skipFocusEvent = $target && $target . not ( $cell ) . is ( NON_FOCUSABLE_ELEMENTS_SELECTOR ) ;
1400- const isEditor = ! ! column && ! column . command && $cell . hasClass ( EDITOR_CELL_CLASS ) ;
1401- const isDisabled = ! isEditor && ( ! args . isHighlighted || skipFocusEvent ) ;
1401+ const isEditCell = ! column ?. command
1402+ && isEditing
1403+ && $cell . hasClass ( EDITOR_CELL_CLASS ) ;
1404+
1405+ const isDisabled = ! isEditCell
1406+ && ( ! args . isHighlighted || skipFocusEvent ) ;
14021407 this . _focus ( $cell , isDisabled , skipFocusEvent ) ;
14031408 }
14041409 } else {
14051410 this . setRowFocusType ( ) ;
14061411 this . setFocusedRowIndex ( args . prevRowIndex ) ;
1407- if ( this . _editingController . isEditing ( ) && isCellEditMode ) {
1412+ if ( isEditing && isCellEditMode ) {
14081413 this . _closeEditCell ( ) ;
14091414 }
14101415 }
You can’t perform that action at this time.
0 commit comments