Skip to content

Commit

Permalink
Release 18.1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
BingoRUS committed Nov 8, 2018
1 parent fe53aa4 commit d7aeefd
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
7 changes: 5 additions & 2 deletions js/ui/grid_core/ui.grid_core.keyboard_navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ var KeyboardNavigationController = core.ViewController.inherit({
data = event.data,
isCellEditMode = this._isCellEditMode(),
columnIndex,
column;
column,
allowUpdating;

if($grid.is(this.component.$element()) && this._isCellValid($target)) {
$target = this._isInsideEditForm($target) ? $(event.target) : $target;
Expand All @@ -137,7 +138,9 @@ var KeyboardNavigationController = core.ViewController.inherit({
} else if(!this._editingController.isEditing() && !this._isMasterDetailCell($target)) {
columnIndex = this.getView("rowsView").getCellIndex($target);
column = this._columnsController.getVisibleColumns()[columnIndex];
if(isCellEditMode && column && column.allowEditing) {
allowUpdating = this.option("editing.allowUpdating");

if(allowUpdating && isCellEditMode && column && column.allowEditing) {
this._isHiddenFocus = false;
} else {
var isInteractiveTarget = $(event.target).not($target).is(INTERACTIVE_ELEMENTS_SELECTOR);
Expand Down
27 changes: 27 additions & 0 deletions testing/tests/DevExpress.ui.widgets.dataGrid/editing.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -2733,6 +2733,33 @@ QUnit.test("The text of the colorBox should not be overlaps in a grid cell", fun
assert.strictEqual($(this.getCellElement(0, 0)).find(".dx-colorbox-input").css("paddingLeft"), DEFAULT_COLORBOX_INPUT_PADDING_LEFT, "padding left");
});

// T682033
QUnit.testInActiveWindow("Focus overlay should not be shown in batch editing mode when editing is disabled", function(assert) {
// arrange
var that = this,
rowsView = this.rowsView,
$testElement = $("#container");

that.options.editing = {
mode: "batch",
allowUpdating: false,
};
that.options.tabIndex = 0;
rowsView.render($testElement);
that.$element = function() {
return $(".dx-datagrid").parent();
};

// act
var $firstCell = $testElement.find("tbody > tr > td").first();
$firstCell.focus();
$firstCell.trigger("dxpointerdown");
that.clock.tick();

// assert
assert.notOk($testElement.find(".dx-datagrid-focus-overlay").is(":visible"), "not visible focus overlay");
});

QUnit.module('Editing with real dataController', {
beforeEach: function() {
this.clock = sinon.useFakeTimers();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4880,7 +4880,7 @@ QUnit.module("Keyboard navigation with real dataController and columnsController

this.options = {
useKeyboard: true,
editing: { mode: 'cell' }
editing: { mode: 'cell', allowUpdating: true }
};

this.setupModule();
Expand Down Expand Up @@ -4944,7 +4944,7 @@ QUnit.module("Keyboard navigation with real dataController and columnsController

this.options = {
useKeyboard: true,
editing: { mode: 'batch' }
editing: { mode: 'batch', allowUpdating: true }
};

this.setupModule();
Expand Down

0 comments on commit d7aeefd

Please sign in to comment.