Fixed: Don't render table options modal content when it's closed

pull/6/head
Qstick 6 years ago
parent 909140988f
commit 9002dd67e1

@ -131,6 +131,8 @@ class TableOptionsModal extends Component {
isOpen={isOpen} isOpen={isOpen}
onModalClose={onModalClose} onModalClose={onModalClose}
> >
{
isOpen ?
<ModalContent onModalClose={onModalClose}> <ModalContent onModalClose={onModalClose}>
<ModalHeader> <ModalHeader>
Table Options Table Options
@ -139,7 +141,7 @@ class TableOptionsModal extends Component {
<ModalBody> <ModalBody>
<Form> <Form>
{ {
hasPageSize && hasPageSize ?
<FormGroup> <FormGroup>
<FormLabel>Page Size</FormLabel> <FormLabel>Page Size</FormLabel>
@ -151,18 +153,19 @@ class TableOptionsModal extends Component {
errors={pageSizeError ? [{ message: pageSizeError }] : undefined} errors={pageSizeError ? [{ message: pageSizeError }] : undefined}
onChange={this.onPageSizeChange} onChange={this.onPageSizeChange}
/> />
</FormGroup> </FormGroup> :
null
} }
{ {
!!OptionsComponent && OptionsComponent ?
<OptionsComponent <OptionsComponent
onTableOptionChange={onTableOptionChange} onTableOptionChange={onTableOptionChange}
/> /> : null
} }
{ {
canModifyColumns && canModifyColumns ?
<FormGroup> <FormGroup>
<FormLabel>Columns</FormLabel> <FormLabel>Columns</FormLabel>
@ -218,7 +221,8 @@ class TableOptionsModal extends Component {
<TableOptionsColumnDragPreview /> <TableOptionsColumnDragPreview />
</div> </div>
</div> </div>
</FormGroup> </FormGroup> :
null
} }
</Form> </Form>
</ModalBody> </ModalBody>
@ -229,7 +233,9 @@ class TableOptionsModal extends Component {
Close Close
</Button> </Button>
</ModalFooter> </ModalFooter>
</ModalContent> </ModalContent> :
null
}
</Modal> </Modal>
); );
} }

Loading…
Cancel
Save