From 47a92a4a42f4de42a5fd053332a79a3f71b30fba Mon Sep 17 00:00:00 2001 From: FlipWarthog Date: Thu, 19 Oct 2023 14:39:39 -0400 Subject: [PATCH] Fix #4652 - Splitter: minSize broken --- components/lib/splitter/Splitter.vue | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/components/lib/splitter/Splitter.vue b/components/lib/splitter/Splitter.vue index 48693d4dc..515d4808e 100644 --- a/components/lib/splitter/Splitter.vue +++ b/components/lib/splitter/Splitter.vue @@ -265,15 +265,21 @@ export default { } }, validateResize(newPrevPanelSize, newNextPanelSize) { - let prevPanelMinSize = ObjectUtils.getVNodeProp(this.panels[0], 'minSize'); + if (newPrevPanelSize > 100 || newPrevPanelSize < 0) return false; + if (newNextPanelSize > 100 || newNextPanelSize < 0) return false; - if (this.panels[0].props && prevPanelMinSize && prevPanelMinSize > newPrevPanelSize) { + let prevIdx = this.prevPanelIndex; + let nextIdx = prevIdx + 1; + + let prevPanelMinSize = ObjectUtils.getVNodeProp(this.panels[prevIdx], 'minSize'); + + if (this.panels[prevIdx].props && prevPanelMinSize && prevPanelMinSize > newPrevPanelSize) { return false; } - let newPanelMinSize = ObjectUtils.getVNodeProp(this.panels[1], 'minSize'); + let newPanelMinSize = ObjectUtils.getVNodeProp(this.panels[nextIdx], 'minSize'); - if (this.panels[1].props && newPanelMinSize && newPanelMinSize > newNextPanelSize) { + if (this.panels[nextIdx].props && newPanelMinSize && newPanelMinSize > newNextPanelSize) { return false; }