@@ -28,18 +28,20 @@ interface IProps extends WithStyles<typeof styles> {
2828 contentDescriptor ?: ContentDescriptorObject ;
2929 hideIcon ?: boolean ;
3030 hideRequired ?: boolean ;
31+ disableTransitionProps ?: boolean ;
3132 uiSchema ?: any ;
3233}
3334
3435class ContentDescriptor extends Component < IProps > {
3536 public render ( ) {
36- const { contentDescriptor, classes, hideIcon, hideRequired, uiSchema } = this . props ;
37+ const { contentDescriptor, classes, hideIcon, hideRequired, uiSchema, disableTransitionProps } = this . props ;
3738 if ( ! contentDescriptor ) { return null ; }
3839 const entries = Object . entries ( contentDescriptor ) ;
3940 if ( entries . length === 0 ) { return null ; }
4041 return (
4142 < ExpansionPanel
4243 style = { { width : "100%" } }
44+ TransitionProps = { { unmountOnExit : disableTransitionProps ? false : true } }
4345 defaultExpanded = { uiSchema && uiSchema . params [ "ui:defaultExpanded" ] }
4446 expanded = { contentDescriptor . name ? undefined : true } >
4547 < ExpansionPanelSummary
@@ -53,8 +55,8 @@ class ContentDescriptor extends Component<IProps> {
5355 </ Typography > }
5456 </ div >
5557 </ ExpansionPanelSummary >
56- < ExpansionPanelDetails style = { { display : "block" } } >
57- < div >
58+ < ExpansionPanelDetails style = { { display : "block" , overflowX : "auto" } } >
59+ < >
5860 { contentDescriptor . description &&
5961 < ReactMarkdown source = { contentDescriptor . description } className = { classes . description } />
6062 }
@@ -64,7 +66,7 @@ class ContentDescriptor extends Component<IProps> {
6466 < JSONSchema schema = { contentDescriptor . schema } />
6567 </ >
6668 }
67- </ div >
69+ </ >
6870 </ ExpansionPanelDetails >
6971 </ ExpansionPanel >
7072 ) ;
0 commit comments