Merge pull request #12972 from Snuffleupagus/pr-12354-followup

[GENERIC viewer] Skip the `iframe`-case when checking if the `container` div, on `BaseViewer`-instances, is absolutely positioned (PR 12354 follow-up)
This commit is contained in:
Tim van der Meij 2021-02-10 00:18:02 +01:00 committed by GitHub
commit 3a2c259b57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -172,7 +172,10 @@ class BaseViewer {
throw new Error("Invalid `container` and/or `viewer` option.");
}
if (getComputedStyle(this.container).position !== "absolute") {
if (
this.container.offsetParent &&
getComputedStyle(this.container).position !== "absolute"
) {
throw new Error("The `container` must be absolutely positioned.");
}
}