mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-10-22 06:49:51 -04:00
fix(paginator): bail from expand() when the iframe document is torn down
A queued resize tick can run against a not-yet-parsed or unloaded
iframe; documentElement is null then and expand() threw inside the
ResizeObserver callback. Observed live in the Android app (twice in
row during boot and page turns). Follows the 50f56ee guard family.
This commit is contained in:
1 parent
ac699e71ee
commit
111898ee0e
2 files changed
+5
-1
No files matched your search
@@ -381,6 +381,10 @@ class View {
|
||||
}
|
||||
}
|
||||
expand() {
|
||||
// A queued resize tick can run against a torn-down or
|
||||
// not-yet-parsed iframe; bail instead of throwing (the caller
|
||||
// re-renders on the next real observation).
|
||||
if (!this.document?.documentElement) return
|
||||
const { documentElement } = this.document
|
||||
if (this.#column) {
|
||||
const side = this.#vertical ? 'height' : 'width'
|
||||
|
||||
Reference in new issue
Block a user