Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/react-split-grid/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ class ReactSplitGrid extends React.Component {
if (columnMinSizes !== prevColumnMinSizes) {
needsRecreate = true
}
// TODO use deep equals
if (columnMaxSizes !== prevColumnMaxSizes) {
needsRecreate = true
}

if (rowMinSizes !== prevRowMinSizes) {
needsRecreate = true
Expand All @@ -94,8 +98,9 @@ class ReactSplitGrid extends React.Component {
// Destroy and re-create split if options changed
if (needsRecreate) {
options.columnMinSizes = columnMinSizes
options.columnMaxSizes = columnMaxSizes
options.rowMinSizes = rowMinSizes

options.rowMaxSizes = rowMaxSizes
this.split.destroy(false)

this.split = Split(options)
Expand Down
8 changes: 8 additions & 0 deletions packages/split-grid/src/Gutter.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,14 @@ class Gutter {
bTrackSize = this.minSizeEnd
}

if (aTrackSize > this.maxSizeStart) {
aTrackSize = this.maxSizeStart;
}

if (bTrackSize > this.maxSizeEnd) {
bTrackSize = this.maxSizeEnd;
}

if (this.trackValues[this.aTrack].type === 'px') {
this.tracks[this.aTrack] = `${aTrackSize}px`
} else if (this.trackValues[this.aTrack].type === 'fr') {
Expand Down