Skip to content

Commit d5752ed

Browse files
Splitter - Panes cannot be expanded/collapsed after window resize (T1262088) (#28651)
1 parent 49226ff commit d5752ed

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
@@ -1305,6 +1305,25 @@ QUnit.module('Pane sizing', moduleConfig, () => {
13051305
}, 10);
13061306
});
13071307
});
1308+
1309+
QUnit.test('The splitter pane can safely collapse if the total size layout calculation error is less than three decimal places (T1262088)', function(assert) {
1310+
this.reinit({
1311+
width: 733.67,
1312+
height: 200,
1313+
items: [ { collapsible: true }, { collapsible: true }, { collapsible: true }],
1314+
});
1315+
1316+
this.assertLayout(['33.3333', '33.3333', '33.3333']);
1317+
1318+
this.instance._layout = [33.3338502509, 33.3338502509, 33.3338502509];
1319+
1320+
const $resizeHandle = this.getResizeHandles().first();
1321+
const $collapsePrevButton = this.getCollapsePrevButton($resizeHandle);
1322+
1323+
$collapsePrevButton.trigger('dxclick');
1324+
1325+
this.assertLayout(['0', '66.6677', '33.3339']);
1326+
});
13081327
});
13091328

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

0 commit comments

Comments
 (0)