fix(Popup): may throw error when using get-container and destroyed
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
// Context
|
||||
import { context } from './context';
|
||||
import { openOverlay, closeOverlay, updateOverlay } from './overlay';
|
||||
|
||||
// Utils
|
||||
import { on, off, preventDefault } from '../../utils/dom/event';
|
||||
import { removeNode } from '../../utils/dom/node';
|
||||
import { getScroller } from '../../utils/dom/scroll';
|
||||
|
||||
// Mixins
|
||||
import { TouchMixin } from '../touch';
|
||||
import { PortalMixin } from '../portal';
|
||||
import { CloseOnPopstateMixin } from '../close-on-popstate';
|
||||
import { on, off, preventDefault } from '../../utils/dom/event';
|
||||
import { openOverlay, closeOverlay, updateOverlay } from './overlay';
|
||||
import { getScroller } from '../../utils/dom/scroll';
|
||||
|
||||
export const popupMixinProps = {
|
||||
// whether to show popup
|
||||
@@ -90,8 +96,8 @@ export function PopupMixin(options = {}) {
|
||||
beforeDestroy() {
|
||||
this.close();
|
||||
|
||||
if (this.getContainer && this.$parent && this.$parent.$el) {
|
||||
this.$parent.$el.appendChild(this.$el);
|
||||
if (this.getContainer) {
|
||||
removeNode(this.$el);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user