Skip to content

Commit 0b88911

Browse files
Splitter - Panes cannot be expanded/collapsed after window resize (T1262088) (#28650)
1 parent cf3f32f commit 0b88911

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

packages/devextreme/js/__internal/ui/splitter/utils/layout.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,7 @@ export function getNextLayout(
220220
}
221221

222222
const totalSize = nextLayout.reduce((total, size) => size + total, 0);
223-
224-
if (!(compareNumbersWithPrecision(totalSize, 100, 3) === 0)) {
223+
if (!(compareNumbersWithPrecision(totalSize, 100, 2) === 0)) {
225224
return currentLayout;
226225
}
227226

packages/devextreme/testing/tests/DevExpress.ui.widgets/splitter.tests.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,25 @@ QUnit.module('Pane sizing', moduleConfig, () => {
13071307
}, resizeObserverTimeout);
13081308
});
13091309
});
1310+
1311+
QUnit.test('The splitter pane can safely collapse if the total size layout calculation error is less than three decimal places (T1262088)', function(assert) {
1312+
this.reinit({
1313+
width: 733.67,
1314+
height: 200,
1315+
items: [ { collapsible: true }, { collapsible: true }, { collapsible: true }],
1316+
});
1317+
1318+
this.assertLayout(['33.3333', '33.3333', '33.3333']);
1319+
1320+
this.instance._layout = [33.3338502509, 33.3338502509, 33.3338502509];
1321+
1322+
const $resizeHandle = this.getResizeHandles().first();
1323+
const $collapsePrevButton = this.getCollapsePrevButton($resizeHandle);
1324+
1325+
$collapsePrevButton.trigger('dxclick');
1326+
1327+
this.assertLayout(['0', '66.6677', '33.3339']);
1328+
});
13101329
});
13111330

13121331
QUnit.module('Resizing', moduleConfig, () => {

0 commit comments

Comments
 (0)