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
6 changes: 5 additions & 1 deletion src/lib/ReflexContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export default class ReflexContainer extends React.Component {
flexData: []
}
this.ref = React.createRef()
this.isSetPropSize = false
}

componentDidMount () {
Expand Down Expand Up @@ -369,6 +370,8 @@ export default class ReflexContainer extends React.Component {
this.computeAvailableOffset(
splitterIdx, dir * offset)

this.isSetPropSize = data.isSetPropSize

this.elements = null

if (availableOffset) {
Expand All @@ -390,6 +393,7 @@ export default class ReflexContainer extends React.Component {
// TODO handle exception ...
console.log(ex)
}
this.isSetPropSize = false
})
}

Expand Down Expand Up @@ -595,7 +599,7 @@ export default class ReflexContainer extends React.Component {

const newSize = Math.max(size + offset, 0)

const currentFlex = this.state.flexData[idx].flex
const currentFlex = this.isSetPropSize ? 0 : this.state.flexData[idx].flex

const newFlex = (currentFlex > 0)
? currentFlex * newSize / size
Expand Down
3 changes: 2 additions & 1 deletion src/lib/ReflexElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ class ReflexElement extends React.Component {
await this.props.events.emit('element.size', {
index: this.props.index,
size: this.props.size,
direction
direction,
isSetPropSize: true
})
}
}
Expand Down