Skip to content

fix(LinkPreview): always clean up the document pointerup listener - #2194

Open
Blackman99 wants to merge 1 commit into
huntabyte:mainfrom
Blackman99:fix/link-preview-pointerup-leak
Open

Blackman99 wants to merge 1 commit into
huntabyte:mainfrom
Blackman99:fix/link-preview-pointerup-leak

Conversation

@Blackman99

Copy link
Copy Markdown

Fixes #2153

The open watcher in LinkPreviewRootState adds a pointerup listener on the document, but when contentNode is still null it returns early, before the cleanup is returned. The listener then never gets removed and keeps firing after the preview closes or unmounts, which is where the repeated derived_inert warnings come from.

This guards the contentNode/tabindex block instead of returning early, so the cleanup is always returned.

  • Added a browser regression test that checks every document pointerup listener is removed after the preview unmounts (fails on main, passes with this change)
  • Added a bits-ui patch changeset

Doesn't touch the separate afterSleep timer issue (#2103) or #2146.

@changeset-bot

changeset-bot Bot commented Oct 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 973196e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
bits-ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor
built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
bits-ui ✅ Ready (View Log) Visit Preview 973196e

This branch was successfully deployed

1 active deployment
Preview — 973196e1 Deployed Oct 9, 2026 by github-actions[bot]
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.

LinkPreview: open-watch leaks its document pointerup listener when contentNode isn't set yet

1 participant