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) (#28650)
  • Loading branch information
EugeniyKiyashko authored Dec 27, 2024
1 parent cf3f32f commit 0b88911
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 @@ -1307,6 +1307,25 @@ QUnit.module('Pane sizing', moduleConfig, () => {
}, resizeObserverTimeout);
});
});

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 0b88911

Please sign in to comment.