Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions e2e/testcafe-devextreme/tests/dataGrid/common/focus/focus.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import DataGrid from 'devextreme-testcafe-models/dataGrid';
import { ClientFunction } from 'testcafe';
import TextBox from 'devextreme-testcafe-models/textBox';
import { GridsEditMode } from 'devextreme/ui/data_grid';
import { createWidget } from '../../../../helpers/createWidget';
import url from '../../../../helpers/getPageUrl';

Expand Down Expand Up @@ -376,3 +377,37 @@ test('Focus method should focus the first data row when focusedRowEnabled = true
},
],
}));

(['batch', 'cell'] as GridsEditMode[]).forEach((editMode) => {
// T1331376
test(`Tab should focus the next cell after editing a cell by API when focusedRowEnabled (editing.mode=${editMode})`, async (t) => {
const dataGrid = new DataGrid(GRID_SELECTOR);
await t.expect(dataGrid.isReady()).ok();

await dataGrid.apiEditCell(0, 0);

await t
.expect(dataGrid.getDataCell(0, 0).getEditor().element.focused)
.ok();

await t.pressKey('tab');

await t
.expect(dataGrid.getDataCell(0, 1).isEditCell)
.ok()
.expect(dataGrid.getDataCell(0, 1).getEditor().element.focused)
.ok();
}).before(async () => createWidget('dxDataGrid', {
dataSource: [
{ ID: 1, FirstName: 'John', LastName: 'Heart' },
{ ID: 2, FirstName: 'Olivia', LastName: 'Peyton' },
],
keyExpr: 'ID',
focusedRowEnabled: true,
editing: {
mode: editMode,
allowUpdating: true,
},
columns: ['FirstName', 'LastName'],
}));
});
Original file line number Diff line number Diff line change
Expand Up @@ -3081,8 +3081,10 @@ const editing = (Base: ModuleType<EditingController>) => class EditingController
}

const isCellEditing = super.editCell(rowIndex, columnIndex);

if (isCellEditing) {
this._keyboardNavigationController.setupFocusedView();
this._keyboardNavigationController.setCellFocusType();
}

return isCellEditing;
Expand Down
Loading