Skip to content

Commit

Permalink
Splitter - Panes cannot be expanded/collapsed after window resize (T1…
Browse files Browse the repository at this point in the history
…262088) (#28651)
  • Loading branch information
EugeniyKiyashko authored Dec 27, 2024
1 parent 49226ff commit d5752ed
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,7 @@ export function getNextLayout(
}

const totalSize = nextLayout.reduce((total, size) => size + total, 0);

if (!(compareNumbersWithPrecision(totalSize, 100, 3) === 0)) {
if (!(compareNumbersWithPrecision(totalSize, 100, 2) === 0)) {
return currentLayout;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,25 @@ QUnit.module('Pane sizing', moduleConfig, () => {
}, 10);
});
});

QUnit.test('The splitter pane can safely collapse if the total size layout calculation error is less than three decimal places (T1262088)', function(assert) {
this.reinit({
width: 733.67,
height: 200,
items: [ { collapsible: true }, { collapsible: true }, { collapsible: true }],
});

this.assertLayout(['33.3333', '33.3333', '33.3333']);

this.instance._layout = [33.3338502509, 33.3338502509, 33.3338502509];

const $resizeHandle = this.getResizeHandles().first();
const $collapsePrevButton = this.getCollapsePrevButton($resizeHandle);

$collapsePrevButton.trigger('dxclick');

this.assertLayout(['0', '66.6677', '33.3339']);
});
});

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

0 comments on commit d5752ed

Please sign in to comment.