Skip to content

Commit

Permalink
fix getting border
Browse files Browse the repository at this point in the history
  • Loading branch information
pomahtri committed Sep 23, 2024
1 parent 66c821b commit 50a5380
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
10 changes: 9 additions & 1 deletion packages/devextreme/js/__internal/grids/grid_core/m_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Deferred, when } from '@js/core/utils/deferred';
import { extend } from '@js/core/utils/extend';
import { each } from '@js/core/utils/iterator';
import { getBoundingRect } from '@js/core/utils/position';
import { getHeight } from '@js/core/utils/size';
import { getHeight, getInnerWidth, getOuterWidth } from '@js/core/utils/size';
import { format } from '@js/core/utils/string';
import { isDefined, isFunction, isString } from '@js/core/utils/type';
import variableWrapper from '@js/core/utils/variable_wrapper';
Expand Down Expand Up @@ -743,4 +743,12 @@ export default {

logSpecificDeprecatedWarningIfNeed(columns);
},

getComponentBorderWidth(that, $rowsViewElement) {
const borderWidth = that.option('showBorders')
? Math.ceil(getOuterWidth($rowsViewElement) - getInnerWidth($rowsViewElement))
: 0;

return borderWidth;
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import $ from '@js/core/renderer';

import type { ColumnHeadersView } from '../column_headers/m_column_headers';
import type { ModuleType } from '../m_types';
import gridCoreUtils from '../m_utils';
import type { ColumnsView } from '../views/m_columns_view';
import type { RowsView } from '../views/m_rows_view';
import { isGroupRow } from '../views/m_rows_view';
Expand Down Expand Up @@ -277,7 +278,7 @@ const rowsView = (
$detailCell
.addClass(this.addWidgetPrefix(CLASSES.stickyColumnLeft))
// @ts-expect-error
.width(componentWidth - 2);
.width(componentWidth - gridCoreUtils.getComponentBorderWidth(this, this._$element));
}

return $detailCell;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ import type { DeferredObj } from '@js/core/utils/deferred';
import { Deferred, when } from '@js/core/utils/deferred';
import { each } from '@js/core/utils/iterator';
import { getBoundingRect } from '@js/core/utils/position';
import {
getHeight,
getInnerWidth, getOuterWidth, getWidth,
} from '@js/core/utils/size';
import { getHeight, getWidth } from '@js/core/utils/size';
import { isDefined, isNumeric, isString } from '@js/core/utils/type';
import { getWindow, hasWindow } from '@js/core/utils/window';
import messageLocalization from '@js/localization/message';
Expand Down Expand Up @@ -508,9 +505,7 @@ export class ResizingController extends modules.ViewController {
resultWidths[lastColumnIndex] = 'auto';
isColumnWidthsCorrected = true;
if (hasWidth === false && !hasPercentWidth) {
const borderWidth = that.option('showBorders')
? Math.ceil(getOuterWidth($rowsViewElement) - getInnerWidth($rowsViewElement))
: 0;
const borderWidth = gridCoreUtils.getComponentBorderWidth(this, $rowsViewElement);

that._maxWidth = totalWidth + scrollbarWidth + borderWidth;
// @ts-expect-error
Expand Down

0 comments on commit 50a5380

Please sign in to comment.