diff --git a/src/renderers/Dialog.tsx b/src/renderers/Dialog.tsx index 226fc08c1..a4c3fda16 100644 --- a/src/renderers/Dialog.tsx +++ b/src/renderers/Dialog.tsx @@ -5,7 +5,7 @@ import {SchemaNode, Schema, Action} from '../types'; import {filter} from '../utils/tpl'; import Modal from '../components/Modal'; import findLast from 'lodash/findLast'; -import {guid, isVisible} from '../utils/helper'; +import {guid, isVisible, autobind} from '../utils/helper'; import {reaction} from 'mobx'; import {Icon} from '../components/icons'; import {ModalStore, IModalStore} from '../store/modal'; @@ -294,6 +294,13 @@ export default class Dialog extends React.Component { }); } + @autobind + getPopOverContainer() { + return (findDOMNode(this) as HTMLElement).querySelector( + `.${this.props.classPrefix}Modal-content` + ); + } + renderBody(body: SchemaNode, key?: any): React.ReactNode { let {render, store} = this.props; @@ -306,6 +313,7 @@ export default class Dialog extends React.Component { disabled: (body && (body as any).disabled) || store.loading, onAction: this.handleAction, onFinished: this.handleChildFinished, + popOverContainer: this.getPopOverContainer, affixOffsetTop: 0, onChange: this.handleFormChange, onInit: this.handleFormInit, diff --git a/src/renderers/Form/Picker.tsx b/src/renderers/Form/Picker.tsx index 43367e7e2..999f41dd1 100644 --- a/src/renderers/Form/Picker.tsx +++ b/src/renderers/Form/Picker.tsx @@ -346,7 +346,7 @@ export default class PickerControl extends React.PureComponent< } @autobind - renderBody() { + renderBody({popOverContainer}: any) { const { render, selectedOptions, @@ -363,7 +363,8 @@ export default class PickerControl extends React.PureComponent< options: options, multiple, onSelect: embed ? this.handleChange : undefined, - ref: this.crudRef + ref: this.crudRef, + popOverContainer }) as JSX.Element; }