You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-27 04:21:52 +03:00
clear width of right panel container when collapsed in grid view
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user