Fixing style errors caused by too low height

This commit is contained in:
陈帅 2018-06-28 17:54:03 +08:00
parent 78e8ab55b5
commit c8217e0bad
2 changed files with 16 additions and 2 deletions

View File

@ -58,6 +58,11 @@ class App extends React.Component {
onClose={this.onClose}
maskClosable={false}
visible={this.state.visible}
style={{
height: 'calc(100% - 55px)',
overflow: 'auto',
paddingBottom: 53,
}}
>
<Form layout="vertical" hideRequiredMark>
<Row gutter={16}>
@ -159,6 +164,7 @@ class App extends React.Component {
padding: '10px 16px',
textAlign: 'right',
left: 0,
background: '#fff',
borderRadius: '0 0 4px 4px',
}}
>

View File

@ -76,7 +76,8 @@ export default class Drawer extends React.Component<
}
renderBody = () => {
if (this.props.destroyOnClose && !this.props.visible) {
const { destroyOnClose , visible, width, placement } = this.props;
if (destroyOnClose && !visible) {
return null;
}
const { prefixCls, title, closable } = this.props;
@ -100,7 +101,14 @@ export default class Drawer extends React.Component<
</button>
);
}
const containerStyle = { width: this.props.width };
let containerStyle: React.CSSProperties = { width };
if (placement === 'left' || placement === 'right') {
containerStyle = {
overflow: 'auto',
height: '100%',
width,
};
}
return (
<div style={containerStyle}>
{header}