Skip to content
Source
Sign inSign up
TanStack/devtools

fix(devtools): stop delegating pointermove on the trigger #544

MergedAlemTuzlakmerged 1 commit intomain fromrefs/pull/544/headmerged by AlemTuzlak View on GitHub

AlemTuzlakcommented

With devtools mounted, a pointermove listener on document can see event.currentTarget === <html> instead of document. This breaks react-resizable-panels' hover cursor after a remount. This PR makes the trigger listen to pointermove on its buttons directly, so Solid no longer installs a delegated pointermove handler on document.

🎯 Changes

  • Solid delegates onPointerMove to one document listener. That handler redefines event.currentTarget with a getter and does not restore it (solid-js 1.9.15 still does this).
  • Each pointermove listener on document that runs after Solid's handler sees <html>. react-resizable-panels reads currentTarget.defaultView, gets undefined, and skips the cursor.
  • The trigger's two pointermove handlers now use on:pointermove, a native listener on the <button>. No other devtools code delegates pointermove.
  • The root cause is in Solid's eventHandler. This PR removes the devtools' part of it.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm test:pr, or these tests do not apply to this pull request.
  • I fully understand the code in this pull request, including any code generated with AI assistance.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Testing

Commands run

  • vitest run in packages/devtools: 371 tests pass, with the existing trigger drag tests that fire pointermove.
  • The new test fails without the fix: expected <html>… to be #document.
  • eslint, tsc, and prettier --check in packages/devtools: pass.
  • I did not run the full pnpm test:pr.

Manual test

  1. Open the StackBlitz repro in #526.
  2. Before this fix: wait for devtools to load, change the Group key, and hover the separator. The cursor stays auto.
  3. After this fix: the cursor is ew-resize after the remount.
  4. Drag the floating trigger and the docked edge tab. Both still move with the pointer.

How this PR makes testing easy

A test in trigger.test.tsx adds a document pointermove listener after the trigger renders and expects currentTarget to be document.

Linked issues

Fixes #526

Risk / rollback

Low. The handlers run on the same buttons, and pointer capture still sends moves to them. Plugins that use Solid's onPointerMove still install the delegated handler. To undo, revert this PR.

🤖 Generated with Claude Code

    1. Warning

      Review limit reached

      You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

      Next included review available in 11 minutes.

      Check out review usage here.

      View limit details

      Limit details: You’ve used all 4 included reviews currently available.

      Learn how review limits work.

      Review configuration:

      ⚙️ Run configuration

      Configuration used: Repository: TanStack/devtools/.coderabbit.yaml

      Review profile: CHILL

      Plan: Advanced

      Run ID: 47cccbb1-b3b7-4337-8c8e-5476d51320ae

      📥 Commits

      Reviewing files that changed from the base of the PR and between afa01fec1751308eb5f60e737e408f2fc34e669a and 6e663121cd2ff495cfc8ae50d2cefb52c815cecc.

      📒 Files selected for processing (3)
      • .changeset/native-trigger-pointermove.md
      • packages/devtools/src/components/trigger.test.tsx
      • packages/devtools/src/components/trigger.tsx
      • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

      Autopilot is currently an internal CodeRabbit preview.


      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    2. nx-cloud[bot](GitHub profile, opens in a new tab)commented

      View your CI Pipeline Execution ↗ for commit 6e663121cd2ff495cfc8ae50d2cefb52c815cecc

      CommandStatusDurationResult
      nx affected --targets=test:eslint,test:sherif,t...✅ Succeeded3m 36sView ↗
      nx run-many --target=test:e2e --parallel=1 --pr...✅ Succeeded1m 14sView ↗
      nx run-many --targets=build --exclude=examples/...✅ Succeeded34sView ↗

      ☁️ Nx Cloud last updated this comment at 2026-10-02 13:54:34 UTC

    3. More templates

      @tanstack/angular-devtools

      npm i https://pkg.pr.new/@tanstack/angular-devtools@544

      @tanstack/devtools

      npm i https://pkg.pr.new/@tanstack/devtools@544

      @tanstack/devtools-a11y

      npm i https://pkg.pr.new/@tanstack/devtools-a11y@544

      @tanstack/devtools-bundler-core

      npm i https://pkg.pr.new/@tanstack/devtools-bundler-core@544

      @tanstack/devtools-client

      npm i https://pkg.pr.new/@tanstack/devtools-client@544

      @tanstack/devtools-rspack

      npm i https://pkg.pr.new/@tanstack/devtools-rspack@544

      @tanstack/devtools-ui

      npm i https://pkg.pr.new/@tanstack/devtools-ui@544

      @tanstack/devtools-utils

      npm i https://pkg.pr.new/@tanstack/devtools-utils@544

      @tanstack/devtools-vite

      npm i https://pkg.pr.new/@tanstack/devtools-vite@544

      @tanstack/devtools-webmcp

      npm i https://pkg.pr.new/@tanstack/devtools-webmcp@544

      @tanstack/devtools-event-bus

      npm i https://pkg.pr.new/@tanstack/devtools-event-bus@544

      @tanstack/devtools-event-client

      npm i https://pkg.pr.new/@tanstack/devtools-event-client@544

      @tanstack/preact-devtools

      npm i https://pkg.pr.new/@tanstack/preact-devtools@544

      @tanstack/react-devtools

      npm i https://pkg.pr.new/@tanstack/react-devtools@544

      @tanstack/solid-devtools

      npm i https://pkg.pr.new/@tanstack/solid-devtools@544

      @tanstack/svelte-devtools

      npm i https://pkg.pr.new/@tanstack/svelte-devtools@544

      @tanstack/vue-devtools

      npm i https://pkg.pr.new/@tanstack/vue-devtools@544

      commit: 6e66312

    4. AlemTuzlak merged thisf315fe8

    5. AlemTuzlak closed this

    6. 🎉 This PR has been released!

      Thank you for your contribution!

Sign in to join this conversation.