Skip to content

Conversation

@InfiniteRain
Copy link

@InfiniteRain InfiniteRain commented Sep 1, 2025

This PR fixes an issue which exists on Firefox and Safari which throws a null error whenever the foliate-view element is destroyed. I assume this happens because these browsers don't automatically clean up the ResizeObserver callbacks once their underlying elements have been destroyed. In any case, adding a simple null check in paginator.js's expand() method fixes the issue.

@johnfactotum
Copy link
Owner

foliate-view has a close() method that calls destroy() on the paginator which then unobserves the document:

foliate-js/view.js

Lines 295 to 297 in bdae473

close() {
this.renderer?.destroy()
this.renderer?.remove()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants