diff --git a/js/ui/grid_core/ui.grid_core.rows.js b/js/ui/grid_core/ui.grid_core.rows.js index f1da21423b59..05df0d2ad506 100644 --- a/js/ui/grid_core/ui.grid_core.rows.js +++ b/js/ui/grid_core/ui.grid_core.rows.js @@ -830,7 +830,7 @@ module.exports = { const rowsHeight = that._getRowsHeight(contentElement.children().first()); const $tableElement = $table || that.getTableElements(); const borderTopWidth = Math.ceil(parseFloat($tableElement.css('borderTopWidth'))); - const heightCorrection = browser.webkit && that._getDevicePixelRatio() >= 2 ? 1 : 0; // T606935 + const heightCorrection = that._getHeightCorrection(); const resultHeight = elementHeightWithoutScrollbar - rowsHeight - borderTopWidth - heightCorrection; if(showFreeSpaceRow) { @@ -853,6 +853,12 @@ module.exports = { } }, + _getHeightCorrection: function() { + const isZoomedWebkit = browser.webkit && this._getDevicePixelRatio() >= 2; // T606935 + const hasExtraBorderTop = browser.mozilla && browser.version >= 70 && !this.option('showRowLines'); + return isZoomedWebkit || hasExtraBorderTop ? 1 : 0; + }, + _columnOptionChanged: function(e) { const optionNames = e.optionNames; diff --git a/testing/tests/DevExpress.ui.widgets.dataGrid/dataGrid.tests.js b/testing/tests/DevExpress.ui.widgets.dataGrid/dataGrid.tests.js index 1570a3c878fe..61958f77e019 100644 --- a/testing/tests/DevExpress.ui.widgets.dataGrid/dataGrid.tests.js +++ b/testing/tests/DevExpress.ui.widgets.dataGrid/dataGrid.tests.js @@ -5624,7 +5624,8 @@ QUnit.test('Freespace row have the correct height when using master-detail with dataRowsHeight += $(this).outerHeight(); }); - const expectedFreeSpaceRowHeight = $contentTable.height() - dataRowsHeight; + const heightCorrection = gridInstance.getView('rowsView')._getHeightCorrection(); + const expectedFreeSpaceRowHeight = $contentTable.height() - dataRowsHeight - heightCorrection; // assert assert.roughEqual($dataGrid.find('.dx-freespace-row').eq(2).height(), expectedFreeSpaceRowHeight, 1, 'Height of the freeSpace row'); diff --git a/testing/tests/DevExpress.ui.widgets.dataGrid/rowsView.tests.js b/testing/tests/DevExpress.ui.widgets.dataGrid/rowsView.tests.js index f81d10d944d2..dc38dd7e5019 100644 --- a/testing/tests/DevExpress.ui.widgets.dataGrid/rowsView.tests.js +++ b/testing/tests/DevExpress.ui.widgets.dataGrid/rowsView.tests.js @@ -2236,19 +2236,18 @@ QUnit.test('Height free space row for virtual scroller', function(assert) { const dataController = new MockDataController({ items: this.items, virtualItemsCount: { begin: 0, end: 0 } }); const rowsView = this.createRowsView(this.items, dataController); const $testElement = $('#container'); - let freeSpaceRowHeight; - let borderTopWidth; - let tableBorderTopWidth; // act rowsView.render($testElement); rowsView.height(400); rowsView.resize(); - borderTopWidth = Math.ceil(parseFloat($(rowsView.element()).css('borderTopWidth'))); - tableBorderTopWidth = Math.ceil(parseFloat(rowsView.getTableElements().css('borderTopWidth'))); + + const borderTopWidth = Math.ceil(parseFloat($(rowsView.element()).css('borderTopWidth'))); + const tableBorderTopWidth = Math.ceil(parseFloat(rowsView.getTableElements().css('borderTopWidth'))); + const heightCorrection = rowsView._getHeightCorrection(); + const freeSpaceRowHeight = 400 - 3 * rowsView._rowHeight - borderTopWidth - tableBorderTopWidth - heightCorrection; // assert - freeSpaceRowHeight = 400 - 3 * rowsView._rowHeight - borderTopWidth - tableBorderTopWidth; assert.equal(rowsView._getFreeSpaceRowElements().css('display'), 'table-row', 'display style is none'); assert.equal(rowsView._getFreeSpaceRowElements()[0].offsetHeight, Math.round(freeSpaceRowHeight), 'height free space row'); }); @@ -6950,6 +6949,24 @@ if(browser.webkit) { }); } +QUnit.test('The vertical scrollbar should not be shown if free space row rendered and showRowLines set false', function(assert) { + // arrange + const rows = [{ values: ['test1', 'test2', 'test3', 'test4'], rowType: 'data' }]; + const columns = ['field1', 'field2', 'field3', 'field4']; + const rowsView = this.createRowsView(rows, null, columns, null, { scrolling: { useNative: true } }); + const $testElement = $('#container'); + + $testElement.parent().wrap($('
').addClass('dx-widget')); + + // act + rowsView.render($testElement); + rowsView.height(700); + rowsView.resize(); + + // assert + assert.strictEqual(rowsView.getScrollbarWidth(), 0, 'There is no vertical scrollbar'); +}); + // T697699 QUnit.test('The vertical scrollbar should not be shown if showScrollbar is always', function(assert) { // arrange