[bugfix] Dialog: overlay incorrect locate when use getContainer (#3041)

This commit is contained in:
neverland
2019-03-22 16:16:35 +08:00
committed by GitHub
parent c1adaebaa6
commit 784b279738
4 changed files with 20 additions and 15 deletions

View File

@@ -60,9 +60,11 @@ function Toast(options = {}) {
clearTimeout(toast.timer);
queue = queue.filter(item => item !== toast);
if (document.body.contains(toast.$el)) {
document.body.removeChild(toast.$el);
const parent = toast.$el.parentNode;
if (parent) {
parent.removeChild(toast.$el);
}
toast.$destroy();
}
}