Skip to content

fix: clean up owned viewer portal containers - #245

Merged
infeng merged 1 commit into
masterfrom
maintenance/issue-158-portal-cleanup
Sep 18, 2026
Merged

infeng merged 1 commit into
masterfrom
maintenance/issue-158-portal-cleanup

Conversation

@infeng

@infeng infeng commented Sep 18, 2026

Copy link
Copy Markdown
Owner

Repeatedly mounting and unmounting Viewer leaves an empty div in document.body on each mount. Inline viewers also append an unused body container. Allocate the default portal only when needed, remove it on unmount or a switch to a custom container, and preserve caller-owned containers.

Related to the container-cleanup portion of #158. This change does not add a ref or imperative API, so the broader report remains open.

Validation: all four new regression tests failed before the fix; all 50 tests and npm run verify pass after it. Chrome 149 reproduced seven accumulating unused divs with npm 3.2.5 across repeated mounts, a never-opened viewer, inline mode, and container switching. The updated build leaves zero extra nodes in every scenario and preserves the custom container. Public-registry scan passed; no dependency or API changes.

@infeng
infeng merged commit 87d8ef1 into master Sep 18, 2026
2 checks passed
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.

1 participant