修复 sdk 用法 image 放大弹框不出现的问题

This commit is contained in:
2betop 2020-04-30 09:40:56 +08:00
parent 9e678ddcca
commit 19cf23c7b5
2 changed files with 4 additions and 2 deletions

View File

@ -8,6 +8,7 @@ export interface ImageGalleryProps {
classnames: ClassNamesFn;
classPrefix: string;
children: React.ReactNode;
modalContainer?: () => HTMLElement;
}
export interface ImageGalleryState {
@ -84,7 +85,7 @@ export class ImageGallery extends React.Component<
}
render() {
const {children, classnames: cx} = this.props;
const {children, classnames: cx, modalContainer} = this.props;
const {index, items} = this.state;
return (
@ -99,6 +100,7 @@ export class ImageGallery extends React.Component<
onHide={this.close}
show={this.state.isOpened}
contentClassName={cx('ImageGallery')}
container={modalContainer}
>
<a
data-tooltip="关闭"

View File

@ -384,7 +384,7 @@ export class RootRenderer extends React.Component<RootRendererProps> {
return (
<RootStoreContext.Provider value={rootStore}>
<ThemeContext.Provider value={this.props.theme || 'default'}>
<ImageGallery>
<ImageGallery modalContainer={env.getModalContainer}>
{
renderChild(
pathPrefix || '',