|
@@ -55,7 +55,7 @@ class Portal extends PureComponent<PortalProps, PortalState> {
|
|
initContainer = (context: ContextValue, catchError = false) => {
|
|
initContainer = (context: ContextValue, catchError = false) => {
|
|
try {
|
|
try {
|
|
let container: HTMLElement | undefined = undefined;
|
|
let container: HTMLElement | undefined = undefined;
|
|
- if (!this.state?.container || !this.el || !Array.from(this.state.container.childNodes).includes(this.el)) {
|
|
|
|
|
|
+ if (!this.el || !this.state?.container || !Array.from(this.state.container.childNodes).includes(this.el)) {
|
|
this.el = document.createElement('div');
|
|
this.el = document.createElement('div');
|
|
const getContainer = this.props.getPopupContainer || context.getPopupContainer || defaultGetContainer;
|
|
const getContainer = this.props.getPopupContainer || context.getPopupContainer || defaultGetContainer;
|
|
const portalContainer = getContainer();
|
|
const portalContainer = getContainer();
|