clear width of right panel container when collapsed in grid view
This commit is contained in:
parent
b63bd5ea54
commit
81c48f07c7
4 changed files with 27 additions and 8 deletions
|
@ -71,14 +71,17 @@ export default class MainSplit extends React.Component {
|
|||
}
|
||||
|
||||
componentDidUpdate(prevProps) {
|
||||
const wasExpanded = !this.props.collapsedRhs && prevProps.collapsedRhs;
|
||||
const wasCollapsed = this.props.collapsedRhs && !prevProps.collapsedRhs;
|
||||
const wasPanelSet = this.props.panel && !prevProps.panel;
|
||||
const wasPanelCleared = !this.props.panel && prevProps.panel;
|
||||
const shouldAllowResizing =
|
||||
!this.props.disableSizing &&
|
||||
!this.props.collapsedRhs &&
|
||||
this.props.panel;
|
||||
|
||||
if (wasExpanded || wasPanelSet) {
|
||||
if (shouldAllowResizing && !this.resizer) {
|
||||
this._createResizer();
|
||||
} else if (wasCollapsed || wasPanelCleared) {
|
||||
} else if (!shouldAllowResizing && this.resizer) {
|
||||
if (this.props.disableSizing) {
|
||||
this.resizer.clearItemSizes();
|
||||
}
|
||||
this.resizer.detach();
|
||||
this.resizer = null;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue